前日在處理jsp頁面時提示錯誤“tomcat #{..} is not allowed in template text”;
項目運行在tomcat5.5上是沒有問題的,但是在tomcat6.0上就會出現上面的錯誤。經過一番網絡搜索,發現原來是JSP2.1規范對#{…}的兼容性問題:
tomcat5.5用的是JSP2.0規范~~~~~

廢話不多說了;
方案一:
參考http://www.javaeye.com/topic/286901上面的操作吧,我沒測試上面說的方法是否好用;

方案二:
step1.在頁面定義字符串變量;
step2.把需要#的位置用剛才定義的變量替換;

<%
String?a?
= ? " # " ;
%>





< input?id = " brithday " ?name = " brithday " ? class = " Wdate " ?type = " text " ?onfocus = " WdatePicker({minDate:'2002-1-1',maxDate:'<%=a%>{%y+1}-12-%ld'}) " ?style = " cursor:pointer " ?readonly = " readonly " />