您现在的位置是:网站首页> 编程资料编程资料
jsp 不支持EL表达式,解决办法_JSP编程_
2023-05-25
282人已围观
简介 jsp 不支持EL表达式,解决办法_JSP编程_
如果有以下内容,表示是Servlet 2.3 / JSP 1.2。
"-//Sun Microsystems, Inc.//DTD Web Application 2.3//EN"
"http://java.sun.com/dtd/web-app_2_3.dtd">
在默认情况下,Servlet 2.3 / JSP 1.2是不支持EL表达式的,而Servlet 2.4 / JSP 2.0支持。
如果web.xml如下设置也不支持EL表达式:
xmlns="http://java.sun.com/xml/ns/javaee"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://java.sun.com/xml/ns/javaee
http://java.sun.com/xml/ns/javaee/web-app_2_5.xsd">
解决方法:
1.修改web.xml文件为(Servlet 2.4 / JSP 2.0):
xmlns="http://java.sun.com/xml/ns/javaee"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://java.sun.com/xml/ns/javaee
http://java.sun.com/xml/ns/javaee/web-app_2_4.xsd">
2.设置某个jsp页面使用el表达式,需要在jsp页面加上(控制单个页面)
<%@ page isELIgnored="false"%>
*.jsp
false
"-//Sun Microsystems, Inc.//DTD Web Application 2.3//EN"
"http://java.sun.com/dtd/web-app_2_3.dtd">
在默认情况下,Servlet 2.3 / JSP 1.2是不支持EL表达式的,而Servlet 2.4 / JSP 2.0支持。
如果web.xml如下设置也不支持EL表达式:
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://java.sun.com/xml/ns/javaee
http://java.sun.com/xml/ns/javaee/web-app_2_5.xsd">
解决方法:
1.修改web.xml文件为(Servlet 2.4 / JSP 2.0):
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://java.sun.com/xml/ns/javaee
http://java.sun.com/xml/ns/javaee/web-app_2_4.xsd">
2.设置某个jsp页面使用el表达式,需要在jsp页面加上(控制单个页面)
<%@ page isELIgnored="false"%>
您可能感兴趣的文章:
相关内容
- jsp 从web.xml读取连接数据库的参数_JSP编程_
- JSP 动态树的实现_JSP编程_
- Java 创建cookie和删除cookie_JSP编程_
- JSP 页面中使用FCKeditor控件(js用法)_JSP编程_
- 解决jsp开发中不支持EL问题_JSP编程_
- JSP上传图片产生 java.io.IOException: Stream closed异常解决方法_JSP编程_
- JSP页面缓存cache技术--浏览器缓存介绍及实现方法_JSP编程_
- response.setContentType()的作用及MIME参数详解_JSP编程_
- jsp中页面之间的跳转forward与sendRedirect的区别_JSP编程_
- 通用弹出层页面(兼容IE、firefox)可关闭控制宽高及屏蔽背景_JSP编程_
