包含无效表达式:javax.el.ELException:
运行时出错:包含无效表达式:javax.el.ELException:,java,jsp,jstl,el,Java,Jsp,Jstl,El,运行时出错: index.jsp(12,8) PWC6038: "${sqlStatement == null}" contains invalid expression(s): javax.el.ELException: Unable to find ExpressionFactory of type: org.apache.el.ExpressionFactoryImpl org.apache.jasper.JasperException: : javax.el.ELExce
index.jsp(12,8) PWC6038: "${sqlStatement == null}" contains invalid expression(s):
javax.el.ELException: Unable to find ExpressionFactory of type:
org.apache.el.ExpressionFactoryImpl
org.apache.jasper.JasperException: : javax.el.ELException: Unable to find ExpressionFactory of type: org.apache.el.ExpressionFactoryImpl
问题:
/WEB-INF/lib
中不应该有任何特定于servletcontainer的JAR文件。Servletcontainer特定的JAR文件应该已经由servlet容器本身提供
查看Tomcat的/lib
文件夹,它已经提供了内部库、JSP、Servlet和EL库。您不需要通过您的webapp提供其中任何一个。如果您仍然这样做,运行时类路径可能会以灾难告终,因为存在重复的不同版本的库。在您的特定情况下,您可能通过webapp提供了随机下载的EL API,该API与运行时类路径中找到的EL impl不匹配,因此无法通过抽象工厂模式找到正确的impl
因此,如果您在/WEB-INF/lib
中去掉了特定于servletcontainer的JAR,那么一切都应该很好。/WEB-INF/lib
应仅包含特定于webapp本身且servletcontainer尚未提供的库
另见:
/lib
或/lib/ext
中不小心试图修复编译错误?我希望我这样做,那么我至少知道我做了坏事。。。。我要重新安装tomcat和我的IDE,看看它是否能解决问题。。。非常感谢。
<servlet>
<servlet-name>SqlGatewayServlet</servlet-name>
<servlet-class>sql.SqlGatewayServlet</servlet-class>
</servlet>
<servlet-mapping>
<servlet-name>SqlGatewayServlet</servlet-name>
<url-pattern>/SqlGateway</url-pattern>
</servlet-mapping>