#{...} is not allowed in template text

问题:

jsp页面引用 onfocus="WdatePicker({dateFmt:'yyyy-MM-dd',minDate:'%y-%M-#{%d+1}',maxDate:'%y-%M-#{%d+180}'})"

特殊符号 # 识别不了,运行就报错下面错误:

#{...} is not allowed in template text

<td><input type="text" class="Wdate" placeholder="设置开学日期" name="termStartTime" onfocus="WdatePicker({dateFmt:'yyyy-MM-dd',minDate:'%y-%M-#{%d+1}',maxDate:'%y-%M-#{%d+180}'})"></td>
			

解决:

在 page 标签内添加:

deferredSyntaxAllowedAsLiteral="true"

<%@ page language="java" import="java.util.*,dao.*,model.*,servlet.*,util.*,static util.ConstantUtil.*" contentType="text/html; charset=utf-8"
    pageEncoding="utf-8" deferredSyntaxAllowedAsLiteral="true"%>

 

上一篇:scrapy callback无效


下一篇:【MySQL】mysql 远程访问不行解决方法 Host is not allowed to connect to this MySQL server