maven中jstl标签,struts2标签库报错问题解决方案

错误信息如下:

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.csdn.net/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> 

 

  • 2
    点赞
  • 2
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值