读书人

WEB.XML配置有关问题

发布时间: 2011-12-20 22:26:40 作者: rapoo

WEB.XML配置问题
用到STRUTS的TAG,在原来的XML里加了
<taglib>
<taglib-uri> /tags/struts-bean </taglib-uri>
<taglib-location> /WEB-INF/tlds/struts-bean.tld </taglib-location>
</taglib>

<taglib>
<taglib-uri> /tags/struts-html </taglib-uri>
<taglib-location> /WEB-INF/tlds/struts-html.tld </taglib-location>
</taglib>

<taglib>
<taglib-uri> /tags/struts-logic </taglib-uri>
<taglib-location> /WEB-INF/tlds/struts-logic.tld </taglib-location>
</taglib>

<taglib>
<taglib-uri> /tags/struts-nested </taglib-uri>
<taglib-location> /WEB-INF/tlds/struts-nested.tld </taglib-location>
</taglib>

<taglib>
<taglib-uri> /tags/struts-tiles </taglib-uri>
<taglib-location> /WEB-INF/tlds/struts-tiles.tld </taglib-location>
</taglib>
但是加了后,就有错,点右边的X后有很长的的一段提示,MULTIPLE ANNOTATION AT THIS LINE...

[解决办法]
<taglib>
<taglib-location> /WEB-INF/struts-html.tld </taglib-location>
<taglib-uri> /WEB-INF/struts-html.tld </taglib-uri>
</taglib>
<taglib>
<taglib-location> /WEB-INF/struts-logic.tld </taglib-location>
<taglib-uri> /WEB-INF/struts-logic.tld </taglib-uri>
</taglib>
<taglib>
<taglib-location> /WEB-INF/struts-bean.tld </taglib-location>
<taglib-uri> /WEB-INF/struts-bean.tld </taglib-uri>
</taglib>
这是自动生成的,你参考一下。
我也是初学者。
[解决办法]
用什么工具生成的??
[解决办法]
加它作什么?我的项目中没加这些进Web.xml里照样正常工作
[解决办法]
<web-app version= "2.4 "
...
</web-app>

把version属性设置为2.4就不用加了!自动找struts的标签
[解决办法]
//在前后加上: <jsp-config> ..... </jsp-config>
<jsp-config>
<taglib>
<taglib-uri> /WEB-INF/tld/struts-bean.tld </taglib-uri>
<taglib-location>
/WEB-INF/tld/struts-bean.tld
</taglib-location>
</taglib>
<taglib>
<taglib-uri> /WEB-INF/tld/struts-html.tld </taglib-uri>
<taglib-location>
/WEB-INF/tld/struts-html.tld
</taglib-location>
</taglib>
<taglib>
<taglib-uri> /WEB-INF/tld/struts-logic.tld </taglib-uri>
<taglib-location>
/WEB-INF/tld/struts-logic.tld
</taglib-location>
</taglib>
<taglib>
<taglib-uri> /WEB-INF/tld/struts-template.tld </taglib-uri>
<taglib-location>
/WEB-INF/tld/struts-template.tld
</taglib-location>
</taglib>
<taglib>


<taglib-uri> /WEB-INF/tld/struts-tiles.tld </taglib-uri>
<taglib-location>
/WEB-INF/tld/struts-tiles.tld
</taglib-location>
</taglib>
<taglib>
<taglib-uri> /WEB-INF/tld/struts-nested.tld </taglib-uri>
<taglib-location>
/WEB-INF/tld/struts-nested.tld
</taglib-location>
</taglib>
<taglib>
<taglib-uri> /WEB-INF/tld/FCKeditor.tld </taglib-uri>
<taglib-location> /WEB-INF/tld/FCKeditor.tld
</taglib-location>
</taglib>
</jsp-config>
[解决办法]
单看你的标签库应该没有什么问题,
[解决办法]
<taglib> 配置应该加在 <jsp-config> ..... </jsp-config> 中间,否则出错

[解决办法]
用到struts的tag不必在web.xml中添加其信息

读书人网 >Java Web开发

热点推荐