浅谈java里的EL表达式在JSP中不能解析的问题
更新时间:2017年05月09日 14:51:21 投稿:jingxian
下面小编就为大家带来一篇浅谈java里的EL表达式在JSP中不能解析的问题。小编觉得挺不错的,现在就分享给大家,也给大家做个参考。一起跟随小编过来看看吧
今天也碰到了el表达式无法解析的事情,于是在网上查询了下,大多说是因为web.xml中声明的版本问题
于是收集了如下版本:
web-app_2_2.xsd <?xml version="1.0" encoding="UTF-8"?> <!DOCTYPE web-app PUBLIC "-//Sun Microsystems, Inc.//DTD Web Application 2.2//EN" "http://java.sun.com/dtd/web-app_2_2.dtd"> <?xml version="1.0" encoding="UTF-8"?> <!DOCTYPE web-app PUBLIC "-//Sun Microsystems, Inc.//DTD Web Application 2.2//EN" "http://java.sun.com/dtd/web-app_2_2.dtd"> web-app_2_3.xsd <?xml version="1.0" encoding="UTF-8"?> <!DOCTYPE web-app PUBLIC "-//Sun Microsystems, Inc.//DTD Web Application 2.3//EN" "http://java.sun.com/dtd/web-app_2_3.dtd"> <?xml version="1.0" encoding="UTF-8"?> <!DOCTYPE web-app PUBLIC "-//Sun Microsystems, Inc.//DTD Web Application 2.3//EN" "http://java.sun.com/dtd/web-app_2_3.dtd"> web-app_2_4.xsd <?xml version="1.0" encoding="UTF-8"?> <web-app xmlns="http://java.sun.com/xml/ns/j2ee" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" version="2.4" xsi:schemaLocation="http://java.sun.com/xml/ns/j2ee http://java.sun.com/xml/ns/j2ee/web-app_2_4.xsd"> <?xml version="1.0" encoding="UTF-8"?> <web-app xmlns="http://java.sun.com/xml/ns/j2ee" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" version="2.4" xsi:schemaLocation="http://java.sun.com/xml/ns/j2ee http://java.sun.com/xml/ns/j2ee/web-app_2_4.xsd"> web-app_2_5.xsd <?xml version="1.0" encoding="UTF-8"?> <web-app xmlns="http://java.sun.com/xml/ns/javaee" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" version="2.5" xsi:schemaLocation="http://java.sun.com/xml/ns/javaee http://java.sun.com/xml/ns/javaee/web-app_2_5.xsd"> <?xml version="1.0" encoding="UTF-8"?> <web-app xmlns="http://java.sun.com/xml/ns/javaee" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" version="2.5" xsi:schemaLocation="http://java.sun.com/xml/ns/javaee http://java.sun.com/xml/ns/javaee/web-app_2_5.xsd">
一一试了一下,还是不行。最后发现,在JSP的声明(<%@page %>)部分加一行,如下:
<%@ page isELIgnored="false" %>
这样设为false才能解析EL表达式。
以上这篇浅谈java里的EL表达式在JSP中不能解析的问题就是小编分享给大家的全部内容了,希望能给大家一个参考,也希望大家多多支持脚本之家。
相关文章
Spring、SpringMVC和SpringBoot的区别及说明
这篇文章主要介绍了Spring、SpringMVC和SpringBoot的区别及说明,具有很好的参考价值,希望对大家有所帮助。2022-10-10
Java-ElementUi中的row-class-name使用
这篇文章主要介绍了Java-ElementUi中的row-class-name使用方式,具有很好的参考价值,希望对大家有所帮助,如有错误或未考虑完全的地方,望不吝赐教2024-08-08
spring boot+thymeleaf+bootstrap实现后台管理系统界面
这篇文章主要为大家详细介绍了spring boot+thymeleaf+bootstrap简单实现后台管理系统界面,文中示例代码介绍的非常详细,具有一定的参考价值,感兴趣的小伙伴们可以参考一下2017-12-12
ArrayList和LinkedList区别及使用场景代码解析
这篇文章主要介绍了ArrayList和LinkedList区别及使用场景代码解析,小编觉得还是挺不错的,具有一定借鉴价值,需要的朋友可以参考下2018-01-01


最新评论