您的位置:首页 > 其它

web.xml配置taglib标签出错

2013-10-26 10:46 218 查看
原文  :  http://www.cnblogs.com/hzj-/articles/1727916.html

在jsp2.0中,且2.4版的DTD验证中,初步估计是由于eclipse在部署时,未对web.xml进行一些校验,而jbuilder则进行了校验,并除非不合法的描述符,而taglib描述符,正确写法是放到<jsp-config></jsp-config>描述符中,如下所示

第一种方法:

    删了这句(记得要保留<web-app>)红叉就不见了。

第二种方法:

    保留不变,把<taglib></taglib>用<jsp-config></jsp-config>包括起来,一样不会提示错误。

Xml代码

<jsp-config>  

    <taglib>  

      <taglib-uri>/cms4j</taglib-uri>  

      <taglib-location>/WEB-INF/tlds/cms4j.tld</taglib-location>  

    </taglib>  

    <taglib>  

      <taglib-uri>/oscache</taglib-uri>  

      <taglib-location>/WEB-INF/tlds/oscache.tld</taglib-location>  

    </taglib>  

  </jsp-config>
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息