struts2标签问题
请问一下,在使用“struts-tags”标签时,是否还需要导入jar包。若需要,导入那个包呢?我在使用<s:……/>标签时,总是提示:严重:Servlet.servic...
请问一下,在使用“struts-tags”标签时,是否还需要导入jar包。若需要,导入那个包呢?我在使用<s:……/>标签时,总是提示:严重: Servlet.service() for servlet jsp threw exception
The Struts dispatcher cannot be found. This is usually caused by using Struts tags without the associated filter. Struts tags are only usable when the request has passed through its servlet filter, which initializes the Struts dispatcher needed for this tag. - [unknown location]
这一条:<%@ taglib uri="/struts-tags" prefix="s" %>,在jsp中已经存在。这是什么错误呢。求解答!!! 展开
The Struts dispatcher cannot be found. This is usually caused by using Struts tags without the associated filter. Struts tags are only usable when the request has passed through its servlet filter, which initializes the Struts dispatcher needed for this tag. - [unknown location]
这一条:<%@ taglib uri="/struts-tags" prefix="s" %>,在jsp中已经存在。这是什么错误呢。求解答!!! 展开
2个回答
展开全部
web.xml
加上:<filter>
<filter-name>struts</filter-name>
<filter-class>
org.apache.struts2.dispatcher.FilterDispatcher
</filter-class>
</filter>
<filter-mapping>
<filter-name>struts</filter-name>
<url-pattern>/*</url-pattern>
</filter-mapping>
如果用的1.6或以上版本,用:
<filter>
<filter-name>struts2</filter-name>
<filter-class>org.apache.struts2.dispatcher.ng.filter.StrutsPrepareAndExecuteFilter</filter-class>
</filter>
<filter-mapping>
<filter-name>struts2</filter-name>
<url-pattern>/*</url-pattern>
</filter-mapping>
加上:<filter>
<filter-name>struts</filter-name>
<filter-class>
org.apache.struts2.dispatcher.FilterDispatcher
</filter-class>
</filter>
<filter-mapping>
<filter-name>struts</filter-name>
<url-pattern>/*</url-pattern>
</filter-mapping>
如果用的1.6或以上版本,用:
<filter>
<filter-name>struts2</filter-name>
<filter-class>org.apache.struts2.dispatcher.ng.filter.StrutsPrepareAndExecuteFilter</filter-class>
</filter>
<filter-mapping>
<filter-name>struts2</filter-name>
<url-pattern>/*</url-pattern>
</filter-mapping>
追问
问题我已经解决了,虽然你所说的这些并不是我想要的答案,但是还是感谢你,相信你所说的这些其他人会需要,给你个最佳!我是刚刚学习struts2的,还望多多指教!
Storm代理
2023-08-29 广告
2023-08-29 广告
"StormProxies是全球大数据IP资源服务商,其住宅代理网络由真实的家庭住宅IP组成,可为企业或个人提供满足各种场景的代理产品。点击免费测试(注册即送1G流量)StormProxies有哪些优势?1、IP+端口提取形式,不限带宽,I...
点击进入详情页
本回答由Storm代理提供
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询