【发布时间】:2013-07-31 19:37:47
【问题描述】:
运行时出错:
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
问题:
- 我该如何调试这个?
- 找不到 ExpressionFactory 类型:org.apache.el.ExpressionFactoryImpl
这就是我所拥有的
- NetBeans IDE 7.3
- 雄猫 7.0
- MySql 连接
这是 Murach 书中的一个简单的 sql 网关
index.jsp
<%@taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<c:if test="${sqlStatement == null}">
<c:set var="sqlStatment" value="select * from User" />
</c:if>
<h1>The SQL Gateway</h1>
<p>Enter an SQL statement and click the execute button. Then, information about the<br/>
statement will appear at the bottom of this page.
</p>
<p><b>SQL Statement:</b></p>
<form action="SqlGateway" method="POST">
<textarea name="sqlStatement" cols="60" rows="8">${sqlStatement}</textarea>
<br/><br/>
<input type="submit" value="Execute">
</form>
<p><b>SQL result:</b></p>
<p>${sqlResult}</p>
web.xml
<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>
我认为 servlet 没有任何问题,但如果您需要我发布它,请告诉我。
【问题讨论】:
-
书中引用的Tomcat版本是什么?
-
看起来 EL 库有问题。您是使用 maven 开发此项目还是将其创建为 Web 项目?
-
Tomcat 6.x。感谢回复
-
@LuiggiMendoza 它是一个网络项目
-
@RomanC 你的意思是什么?该应用程序应该在 Tomcat 6 和 7 上都能正常运行。