maven 部署的项目,访问时500错误:org.apache.jasper.JasperException: Unable to compile class for JSP:

目前还不知道怎么解决,待更新。。。

环境

jdk-13.0.2
tomcat 7
idea IntelliJ IDEA 2019.3.4 x64

大概知道是tomcat和jdk版本号不匹配的原因。
name首先从tomcat官网找一下tomcat的版本吧
tomcat官网
找到一张版本映射图
The mapping between the specifications and the respective Apache Tomcat versions is:
版本比对图
找到了一句貌似关键的话:

If the new Java version introduces new language features then the default JSP compiler may not support them immediately. Switching the JSP compiler to javac may enable these new language features to be used in JSPs.

翻译:就是如果新的java版本推出了新的语言特性,而默认的JSP编译器不会马上就能支持他们。。。

整了半天,我把jdk换成了1.8 然后baidu了一下,按照官网给的表,tomcat6是支持jdk5,并且向后兼容没错,但在maven中,tomcat6与jdk1.8就是不兼容的,把tomcat6换成tomcat7就万事大吉了。附上在pom.xml配置tomcat7的代码:

  <build>
        <plugins>
			<plugin>
         	 	 <groupId>org.apache.tomcat.maven</groupId>
          		 <artifactId>tomcat7-maven-plugin</artifactId>
         		 <version>2.2</version>
        	</plugin>
        </plugins>
  </build>

这样,maven配置的tomcat就能解析jsp了。

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值