错误信息如下:
1. The absolute uri:[http://java.sun.com/jsp/jstl/core] cannot be resolved in either web.xml or the jar files deployed with this application
2. Unable to find taglib "s" for URI: /struts-tags
(由于本人已解决该错误,该图片来源于https://blog.youkuaiyun.com/baidu_32377671/article/details/78433474)
① jstl标签解决方案:
1. 导入jstl (注意版本问题)
<!-- jstl -->
<dependency>
<groupId>jstl</groupId>
<artifactId>jstl</artifactId>
<version>1.2</version>
</dependency>
如果导入的jstl版本为1.2,则不用再导入standard包,因为1.2中已经包含了standard包。
如果jstl版本为1.1.2,则需要导入standard.1.1.2包。
2. 找到jar包下的META-INF文件夹下的c.tld文件,将其复制到项目的webapp/WEB-INF文件夹下即可。
3. 一般情况上述步骤足以解决,如果不可以,再配置web.xml
<jsp-config>
<taglib>
<taglib-uri>http://java.sun.com/jsp/jstl/core</taglib-uri>
<taglib-location>/WEB-INF/c.tld</taglib-location>
</taglib>
</jsp-config>
② struts2标签库问题解决
1. 导入struts2-core.jar包依赖(此处版本锁定为:<struts.version>2.3.24</struts.version>)
<dependency>
<groupId>org.apache.struts</groupId>
<artifactId>struts2-core</artifactId>
</dependency>
2. 将该包下的struts-tags.tld文件复制到项目的webapp/WEB-INF文件夹下即可。
3. 如果问题没有解决,配置web.xml
<jsp-config>
<taglib>
<taglib-uri>/struts-tags</taglib-uri>
<taglib-location>/WEB-INF/struts-tags.tld</taglib-location>
</taglib>
</jsp-config>