最近正在學習spring mvc 2.5,發現基於annotation的配置相當好用。但遇到一個el表達式實效的問題,經過一段時間的研究,終於得到解決。
環境:tomcat5.5
web.xml
<web-app 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" version="2.4">
2.4版本默認支持el表達式,如果使用2.5版本,默認el表達式是關閉的
那麼jsp頁面裏應該增加<%@ page isELIgnored="false"%>