绝对uri:http://struts.apache.org/tags-bean不能在web.xml或与此应用程序一起部署的jar文件中解析。...

问题

访问Struts标记库JSP文件时,Struts会出现常见错误消息。





org.apache.jasper.JasperException: The absolute uri: 
http://struts.apache.org/tags-bean 

org.apache.jasper.JasperException: The absolute uri: 
http://struts.apache.org/tags-html 

org.apache.jasper.JasperException: The absolute uri: 
http://struts.apache.org/tags-logic 

org.apache.jasper.JasperException: The absolute uri: 
http://struts.apache.org/tags-tiles 

cannot be resolved in either web.xml or 
the jar files deployed with this application

这是因为您没有配置Struts标记库属性,所以在项目依赖项中找不到tld文件。

1. Strut标签库手动配置

如果您是手动配置Struts标记库,则在Struts版本<= 1.1和Servlet <2.3容器中使用 。 请确保将以下“ tld ”文件复制到WEB-INF文件夹,您可以在Struts库文件夹中找到这些文件。

  • struts-bean.tld
  • struts-html.tld
  • struts-logic.tld
  • struts-tiles.tld

并在web.xml中正确定义
web.xml


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

2. Strut标签库自动配置

如果要自动配置Struts标记库,则在Servlet 2.3 / 2.4版和Struts 1.2或1.3框架中使用。 确保struts-taglib.jar位于/ WEB-INF / lib目录中。

您可以在此处检查Struts标记库的配置详细信息

3. Eclipse IDE调试会话

如果这是在Eclipse IDE调试会话期间发生的,只需确保将项目依赖项部署到正确的文件夹即可。 请查看本文以获取解决方案

结论

问题的原因可能因项目而异,但解决方案始终相同

  • 检查tld文件是否在WEB-INF(旧的Struts样式)中可用。
  • 检查taglib uri是否有拼写错误。
  • 检查struts-taglib.jar是否在/ WEB-INF / lib或项目依赖项中可用(新的Struts样式)。

From: https://mkyong.com/struts/the-absolute-uri-httpstruts-apache-orgtags-bean-cannot-be-resolved-in-either-web-xml-or-the-jar-files-deployed-with-this-application/

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值