阿熊
阿熊
元老
发贴: 5644
积分: 454
|
于 2013-03-18 18:15
   
用JSP标签做一个页面: <ext:form.formPanel layout="accordion" layout="column" layoutConfig="2" height="200" width="538" title="add-book" renderTo="f4b49abe-684c-40d9-96d8-80af393c2f0e"> <ext:panel layout="form" style="margin:5px" border="false"> <ext:form.textField allowBlank="false" width="150" fieldLabel="图书名称" name="bookName" ></ext:form.textField> </ext:panel> </ext:form.formpanel> 这个页面在tomcat6及以下版本中是没有问题的但是在tomcat7中会抛异常:
org.apache.jasper.JasperException: /test.jsp (line: 15, column: 54) Attribute qualified names must be unique within an element
经过在网上查找发现是因为在高版本的tomcat中对JSP标签的语法校验更加严格了。因为上面我设置了两遍layout:
<ext:form.formPanel layout="accordion" layout="column"
所以导致tomcat检验不通过从而抛出异常。只要将标签属性规范化只留一个就好了。有时候一些判断比如:
<c:if test="<%= BeanUtils.getProperty(this,"reader")!=null %>"> reader:<%= BeanUtils.getProperty(this,"reader") %>, </c:if>
这样一样不会通过因为他用了双引号里面又包双引号一样会抛异常要修改一下才能在高版本的tomcat中通过:
<c:if test='<%= BeanUtils.getProperty(this,"reader")!=null %>'> reader:<%= BeanUtils.getProperty(this,"reader") %>, </c:if>
这样就OK了
|