日期:2014-05-17  浏览次数:20586 次

问一个关于JSP中引入标签库的问题
<%@ taglib uri="http://struts.apache.org/tags-logic" prefix="logic" %>
这句话写到jsp文件里,为什么显示错误,错误原因是:Can't find the tag library descriptor for "http://struts.apache.org/tags-logic",如果要用logic标签库,该怎么引入呢?

------解决方案--------------------
jar 没引入。你按住ctrl  然后鼠标移到uri看是否会出现链接。
------解决方案--------------------

<taglib>
<taglib-uri>http://struts.apache.org/tags-logic</taglib-uri>
<taglib-location>/WEB-INF/tld/xx.tld</taglib-location>
</taglib>

web.xml来个
------解决方案--------------------
嗯,struts核心包没有引入
------解决方案--------------------
引用:
Quote: 引用:


<taglib>
<taglib-uri>http://struts.apache.org/tags-logic</taglib-uri>
<taglib-location>/WEB-INF/tld/xx.tld</taglib-location>
</taglib>

web.xml来个

把这段代码放到web.xml里直接报错了。。。
<taglib-location>/WEB-INF/tld/xx.tld</taglib-location>改成你自己的struts标签的路径了吗?。。
------解决方案--------------------
一、antlr.jar,commons-beanutils.jar,commons-digester.jar
commons-fileupload.jar,commons-logging.jar,commons-validator.jar,
jakarta-oro.jar,struts.jar这些jar看下jar包有没导入。
二、
在web.xml里面配置写上
<taglib>
<taglib-uri>/WEB-INF/tlds/c.tld</taglib-uri>
<taglib-location>/WEB-INF/tlds/c.tld</taglib-location>
</taglib>
页面中写:
<%@ taglib uri="/WEB-INF/tlds/c.tld" prefix="c"%>
试试看吧,希望有用。
------解决方案--------------------
引用:
Quote: 引用:

Quote: 引用:

Quote: 引用:


<taglib>
<taglib-uri>http://struts.apache.org/tags-logic</taglib-uri>
<taglib-location>/WEB-INF/tld/xx.tld</taglib-location>
</taglib>

web.xml来个

把这段代码放到web.xml里直接报错了。。。
<taglib-location>/WEB-INF/tld/xx.tld</taglib-location>改成你自己的struts标签的路径了吗?。。

本地都没有/WEB-INF/tld这个目录。。。
没有当然会报错,可以参考7楼
------解决方案--------------------
引用:
Quote: 引用:

Quote: 引用:

Quote: 引用:

Quote: 引用: