Java开发网 Java开发网
注册 | 登录 | 帮助 | 搜索 | 排行榜 | 发帖统计  

您没有登录

» Java开发网 » Application Server  

按打印兼容模式打印这个话题 打印话题    把这个话题寄给朋友 寄给朋友    该主题的所有更新都将Email到你的邮箱 订阅主题
flat modethreaded modego to previous topicgo to next topicgo to back
作者 tomcat7引起 Attribute qualified names must be unique
阿熊

阿熊

元老


发贴: 5644
积分: 454
于 2013-03-18 18:15 user profilesend a private message to usersearch all posts byselect and copy to clipboard. 
ie only, sorry for netscape users:-)add this post to my favorite list
用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了




flat modethreaded modego to previous topicgo to next topicgo to back
  已读帖子
  新的帖子
  被删除的帖子
Jump to the top of page

   Powered by Jute Powerful Forum® Version Jute 1.5.6 Ent
Copyright © 2002-2021 Cjsdn Team. All Righits Reserved. 闽ICP备05005120号-1
客服电话 18559299278    客服信箱 714923@qq.com    客服QQ 714923