访问servlet,但是不能跳转”/hello.jsp”
(request.getRequestDispatcher(“/hello.jsp”).forward…)
解决方案:
在pom文件中添加代码,推测是tomcat和JDK版本不兼容导致
<plugin>
<groupId>org.apache.tomcat.maven</groupId>
<artifactId>tomcat7-maven-plugin</artifactId>
<version>2.2</version>
<configuration>
<port>8888</port>
</configuration>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-compiler-plugin</artifactId>
<configuration>
<target>1.6</target>
<source>1.6</source>
<encoding>UTF-8</encoding>
</configuration>
</plugin>
下载安装了最新的tomcat [最新版本官网下载地址]
(
https://tomcat.apache.org/download-90.cgi
)
JDK则是选择1.6低版本,高版本一直报错!
版权声明:本文为limon12349原创文章,遵循 CC 4.0 BY-SA 版权协议,转载请附上原文出处链接和本声明。