Home  >  Q&A  >  body text

java - spring工程引入ModelAndView 类报错,can not resolve ?

写一个maven+spring的demo程序,但是引入ModelAndView类时报错,无法解析,导入其他类就没有问题,不知道错在哪里?

天蓬老师天蓬老师2765 days ago865

reply all(1)I'll reply

  • 迷茫

    迷茫2017-04-18 10:36:45

    Let’s see if the situation is similar. I have imported: import com.alibaba.fastjson.JSON;I keep reporting errors, but the class file does not have a red xx:

    I just modified the compiled jdk version of Maven. It seems that your jdk version has not been modified either:

    <build>
        <plugins>
            <!-- Compiler 插件, 设定JDK版本 -->
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-compiler-plugin</artifactId>
                <version>2.5.1</version>
                <configuration>
                    <source>1.7</source>
                    <target>1.7</target>
                    <showWarnings>true</showWarnings>
                </configuration>
            </plugin>
        </plugins>
    </build>

    reply
    0
  • Cancelreply