今天在使用maven 創建web項目時,發現jsp頁面中的el表達式不起作用。
經過查找發現,在servlet 2.4 之前 <%@ page isELIgnored="true" %> jsp默認的EL表達式是忽略掉的。
可以替換爲web.xml 修改爲
<web-app xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://java.sun.com/xml/ns/javaee" xmlns:web="http://java.sun.com/xml/ns/javae/web-app_2_5.xsd" xsi:schemaLocation="http://java.sun.com/xml/ns/javaee http://java.sun.com/xml/ns/javaee/web-app_2_5.xsd" version="2.5">
默認可使用el表達式