原文地址:http://hi.baidu.com/tediou/blog/item/5d0dce556f7a4a828d5430ca.html
现象为如下的web.xml在Eclipse Helios中出现警告信息
WebTest
index.html
index.htm
index.jsp
default.html
default.htm
default.jsp
action
org.apache.struts.action.ActionServlet
config
/WEB-INF/struts-config.xml
debug
3
detail
3
0
action
*.do
Set Character Encoding
WebTest.SetCharacterEncodingFilter
Set Character Encoding
/*
/tags/struts-bean
/WEB-INF/lib/struts-bean.tld
/tags/struts-html
/WEB-INF/lib/struts-html.tld
/tags/struts-logic
/WEB-INF/lib/struts-logic.tld
错误信息:
Description Resource Path Location Type
cvc-complex-type.2.4.a: Invalid content was found starting with element 'taglib'.
One of '{
"":description,
"":display-name,
"":icon,
"":distributable,
"":context-param,
"":filter,
"":filter-mapping,
"":listener,
"":servlet,
"":servlet-mapping,
"":session-config,
"":mime-mapping,
"":welcome-file-list,
"":error-page,
"":jsp-config,
"":security-constraint,
"":login-config,
"":security-role,
"":env-entry,
"":ejb-ref,
"":ejb-local-ref,
"":service-ref,
"":resource-ref,
"":resource-env-ref,
"":message-destination-ref,
"":message-destination,
"":locale-encoding-mapping-list}' is expected.
web.xml /WebTest/WebContent/WEB-INF line 41 XML Problem
原因:
在jsp2.0中,且2.4版的DTD验证中,taglib描述符,正确写法是放到
描述符中。
解决办法:
1)将
改为,去除验证。
2)按规范,把taglib标签放进jsp-config标签中。如下:
/tags/struts-bean
/WEB-INF/lib/struts-bean.tld
/tags/struts-html
/WEB-INF/lib/struts-html.tld
/tags/struts-logic
/WEB-INF/lib/struts-logic.tld
阅读(1816) | 评论(0) | 转发(0) |