解决<%@taglib prefix="s" uri="/struts-tags"%>显示找不到

问题:

jsp中使用<%@taglib prefix="s" uri="/struts-tags"%>显示找不到

 

解决方法:

在web.xml中插入标签属性:

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

对于servlet2.3版本,插入在<web-app></web-app>中即可;

对于servlet2.4版本,需插入在<jsp-config></jsp-config>中,其中jsp-config可以是web-app中的标签

 

若上述步骤还是不能解决当前问题,则把struts2-corejar包中的/META-INF/struts-tags.tld的内容拷贝出来,放在自己的WEB-INF下面,亲测解决

posted @ 2019-08-12 16:26  初次的告白  阅读(3273)  评论(2编辑  收藏  举报