struts2 ognl 与 jsp2.1 el 的冲突问题
来源:互联网 发布:数据恢复精灵电脑版 编辑:程序博客网 时间:2024/05/12 12:07
tomcat6 , jetty6 采用 jsp2.1。
由于 nio 带来的性能提升,tomcat6 不能被忽略。
办法1:
http://www.devzuz.org/blogs/bporter/2006/08/05/1154706744655.html
<ww:select list="#{'default' : 'Maven 2.x Repository', 'legacy' : 'Maven 1.x Repository'}" />
改用-------------------------------------------------------------
<ww:select list="#@java.util.HashMap@{'default' : 'Maven 2.x Repository', 'legacy' : 'Maven 1.x Repository'}" />
这样 jsp2.1 el 就不会有问题了。
办法2: 对于旧的程序,不愿意改了,可以向后兼容
http://today.java.net/lpt/a/272#backwards-compatibility
必须用 Servlet 2.5 XSD.
<web-app xmlns="http://java.sun.com/xml/ns/javaee" version="2.5" 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">
由于 nio 带来的性能提升,tomcat6 不能被忽略。
办法1:
http://www.devzuz.org/blogs/bporter/2006/08/05/1154706744655.html
<ww:select list="#{'default' : 'Maven 2.x Repository', 'legacy' : 'Maven 1.x Repository'}" />
改用-------------------------------------------------------------
<ww:select list="#@java.util.HashMap@{'default' : 'Maven 2.x Repository', 'legacy' : 'Maven 1.x Repository'}" />
这样 jsp2.1 el 就不会有问题了。
办法2: 对于旧的程序,不愿意改了,可以向后兼容
http://today.java.net/lpt/a/272#backwards-compatibility
必须用 Servlet 2.5 XSD.
<web-app xmlns="http://java.sun.com/xml/ns/javaee" version="2.5" xmlns:xsi="http://www.
<jsp-property-group>
<deferred-syntax-allowed-as-literal>
true
</deferred-syntax-allowed-as-literal>
</jsp-property-group>
或者在页面中<%@page language="java" deferredSyntaxAllowedAsLiteral="true" %>
> <jsp-config>
办法3 :不用 jsp2.1 el
> <jsp-property-group>
> <url-pattern>*.jsp</url-pattern>
> <el-ignored>true</el-ignored>
> </jsp-property-group>
> </jsp-config>
http://www.mail-archive.com/dev@struts.apache.org/msg28920.html
我现在的疑问
在一个页面中采用两个 el 引擎,是否会对性能造成一定影响?
较小。
tomcat6 , jetty6 采用 jsp2.1。
由于 nio 带来的性能提升,tomcat6 不能被忽略。
办法1:(全英文方法)
Jetty 6 (which I use for day to day development) automatically uses JSP 2.1 if you are on JDK 5.0 or above, regardless of what you have specified in web.xml.
This had been biting me on WebWork, because of the introduction of unified EL. The following is no longer valid:
<ww:select list="#{'default' : 'Maven 2.x Repository', 'legacy' : 'Maven 1.x Repository'}" />
But, to escape it with /#{ doesn't work on Tomcat 5 and other 2.0 containers.
The solution?
<ww:select list="#@java.util.HashMap@{'default' : 'Maven 2.x Repository', 'legacy' : 'Maven 1.x Repository'}" />
Thank goodness OGNL had this other syntax for maps that doesn't look like an expression :)
<ww:select list="#{'default' : 'Maven 2.x Repository', 'legacy' : 'Maven 1.x Repository'}" />
改用-------------------------------------------------------------
<ww:select list="#@java.util.HashMap@{'default' : 'Maven 2.x Repository', 'legacy' : 'Maven 1.x Repository'}" />
这样 jsp2.1 el 就不会有问题了。
办法2: 对于旧的程序,不愿意改了,可以向后兼容
http://today.java.net/lpt/a/272#backwards-compatibility
必须用 Servlet 2.5 XSD.
<web-app xmlns="http://java.sun.com/xml/ns/javaee" version="2.5" 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">
<jsp-property-group>
<deferred-syntax-allowed-as-literal>
true
</deferred-syntax-allowed-as-literal>
</jsp-property-group>
或者在页面中
<%@page language="java" deferredSyntaxAllowedAsLiteral="true" %>
办法3 :不用 jsp2.1 el
> <jsp-config>
> <jsp-property-group>
> <url-pattern>*.jsp</url-pattern>
> <el-ignored>true</el-ignored>
> </jsp-property-group>
> </jsp-config>
- struts2 ognl 与 jsp2.1 el 的冲突问题
- webwork ognl的list集合与jsp el 冲突问题解决
- Struts2的ognl与JSP的el表达式取值问题
- Struts2对EL的改变和OGNL
- struts2的EL表达式和Ognl表达式
- struts2 ognl and el
- JSTL中EL标签与Struts2中OGNL标签在JSP页面上的区别
- JSTL中EL标签与Struts2中OGNL标签在JSP页面上的区别
- JSTL中EL标签与Struts2中OGNL标签在JSP页面上的区别
- Struts2标签、Ognl表达式、el表达式、jstl标签库这四者之间的关系与各自使用
- EL与OGNL的对比使用
- ognl与(jstl +EL)的pk
- EL与OGNL的对比使用
- EL与OGNL标签的对比使用
- javabean属性与struts2冲突的问题
- jsp2-el
- struts2的ognl与valuestack
- Struts2小结-ValueStack-OGNL-EL
- 对辐射度算法进行多线程优化的总结
- 使用wordpress的心得
- Linux/Unix环境下的make命令详解
- AjaxControlToolkit安装指南(转自于网络)
- Java 构造函数
- struts2 ognl 与 jsp2.1 el 的冲突问题
- 如何开启Linux的telnet服务
- 婚前与婚后
- BusyBox 简化嵌入式 Linux 系统
- Oracle817与Oracle7.3.4存储过程动态游标的区别
- SSH(struts+spring+hibernate)迅速开发--第三章 生成POJO对象和表映射(1)
- Fractal Software Composition Framework
- java get properties
- gridview 嵌套 dropdownlist 不点编辑 直接回传进行事件操作