在使用jsp的el表达式时,发现tomcat 5对其不解析。按原样输出如${items}.
原样把tomcat 的jsp例子拷过来还是如此。web.xml里和lib里的配置都配好了。找了很久才发现web.xml文件使用的是servlet 2.3版本的声明的问题。el在servlet 2.3中默认是不启用的。
servlet 2.3的






tomcat自带的 servlet 2.4的。




把web.xml的声明部分改为2.4的即可。
还有就是如果使用了<taglib>标签就需要加<jsp-config>父标签。具体内容看jsp2.0和servlet2.4规范
<jsp-config>
<taglib>
<taglib-uri>/tags/struts-bean.tld</taglib-uri>
<taglib-location>/WEB-INF/struts-bean.tld</taglib-location>
</taglib>
</jsp-config>
在使用jsp的el表达式时,发现tomcat 5对其不解析。按原样输出如${items}.
原样把tomcat 的jsp例子拷过来还是如此。web.xml里和lib里的配置都配好了。找了很久才发现web.xml文件使用的是servlet 2.3版本的声明的问题。el在servlet 2.3中默认是不启用的。
servlet 2.3的






tomcat自带的 servlet 2.4的。




把web.xml的声明部分改为2.4的即可。
还有就是如果使用了<taglib>标签就需要加<jsp-config>父标签。具体内容看jsp2.0和servlet2.4规范
<jsp-config>
<taglib>
<taglib-uri>/tags/struts-bean.tld</taglib-uri>
<taglib-location>/WEB-INF/struts-bean.tld</taglib-location>
</taglib>
</jsp-config>