JSP 不能用 不支持 STRUTS标签 报错 The Struts dispatcher cannot be found.

JSP页加了<%@ taglib prefix="s" uri="/struts-tags"%> 以后,运行显示报错:

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]
 at org.apache.struts2.views.jsp.TagUtils.getStack(TagUtils.java:60)
 at org.apache.struts2.views.jsp.StrutsBodyTagSupport.getStack(StrutsBodyTagSupport.java:44)
 at org.apache.struts2.views.jsp.ComponentTagSupport.doStartTag(ComponentTagSupport.java:48)
 at org.apache.jsp.messageBoard.showMessage_jsp._jspx_meth_s_005fiterator_005f0(showMessage_jsp.java:148)
 at org.apache.jsp.messageBoard.showMessage_jsp._jspService(showMessage_jsp.java:119)
 at org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:70)
 at javax.servlet.http.HttpServlet.service(HttpServlet.java:717)
 at org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:374)
 at org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:342)
 at org.apache.jasper.servlet.JspServlet.service(JspServlet.java:267)
 at javax.servlet.http.HttpServlet.service(HttpServlet.java:717)
 at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:290)
 at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
 at org.springframework.web.filter.CharacterEncodingFilter.doFilterInternal(CharacterEncodingFilter.java:88)
 at org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:76)
 at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:235)
 at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
 at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:233)
 at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:191)
 at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:128)
 at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:102)
 at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:109)
 at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:286)
 at org.apache.coyote.http11.Http11AprProcessor.process(Http11AprProcessor.java:857)
 at org.apache.coyote.http11.Http11AprProtocol$Http11ConnectionHandler.process(Http11AprProtocol.java:565)
 at org.apache.tomcat.util.net.AprEndpoint$Worker.run(AprEndpoint.java:1509)
 at java.lang.Thread.run(Thread.java:619)

其实 好办,只要在WEB.XML中加入一个过滤器就行了:

<filter-mapping>
<filter-name>struts2</filter-name>
<url-pattern>*.jsp</url-pattern>
</filter-mapping> 
时间: 2024-09-23 00:29:05

JSP 不能用 不支持 STRUTS标签 报错 The Struts dispatcher cannot be found.的相关文章

mybatis-shiro JSP使用标签报错

问题描述 shiro JSP使用标签报错 在JSP页面使用shiro标签报错,要怎么改?求大神指点java.lang.IllegalArgumentException: Wildcard string cannot be null or empty. Make sure permission strings are properly formatted. org.apache.shiro.authz.permission.WildcardPermission.setParts(WildcardP

spring-shiro jsp标签报错,大神给帮忙看下

问题描述 shiro jsp标签报错,大神给帮忙看下 页面用标签,报错,为何? java.lang.IllegalArgumentException: Wildcard string cannot be null or empty. Make sure permission strings are properly formatted. at org.apache.shiro.authz.permission.WildcardPermission.setParts(WildcardPermiss

学习struts convention报错,搞不定,求支援

问题描述 学习struts convention报错,搞不定,求支援 web.xml: <!-- struts 配置 --> struts2 org.apache.struts2.dispatcher.ng.filter.StrutsPrepareAndExecuteFilter <filter-mapping> <filter-name>struts2</filter-name> <url-pattern>/*</url-pattern&

spring mvc与struts 整合报错

问题描述 spring mvc与struts 整合报错 报错如下求帮忙,谢谢严重: Exception starting filter struts2Unable to load configuration. - action - file:/E:/java/eclipse/.metadata/.plugins/org.eclipse.wst.server.core/tmp0/wtpwebapps/bishe/WEB-INF/classes/struts.xml:11:74 at org.apa

eclipse-Eclipse struts 404报错

问题描述 Eclipse struts 404报错 谁能帮我看看上图到底哪错了吗,我都把struts简化成这样了它还给我报404错? 下面是LoginAction.java代码: import com.opensymphony.xwork2.ActionSupport; public class LoginAction extends ActionSupport{ private String username; private String password; public String ge

html-插入jstl标签报错,求大神帮忙看下,网上解决方案都是错的

问题描述 插入jstl标签报错,求大神帮忙看下,网上解决方案都是错的 com.neusoft.unieap.action.EAPActionServlet.process(EAPActionServlet.java:814) >> org.apache.jasper.JasperException: Validation error messages from TagLibraryValidator for c null: org.xml.sax.SAXParseException: Attr

java-返回jsp只有一堆输出数据没有页面报错原因说不能在response之后再一次请求session

问题描述 返回jsp只有一堆输出数据没有页面报错原因说不能在response之后再一次请求session ![ 解决方案 一次请求一次响应, 你的响应 已经配 response.getWriter() 响应了, springmvc 的 ViewResolver 找不到这样一个请求 当然就报错了 解决方案二: 你可以通过session().setAttribute(""H""hello"");来保存内容hello 需要时,可通过session().

急急急急急急~JSP使用struts2标签报错啊~本机没问题,在服务器就有问题

问题描述 我写的项目,web.xml配置了<filter><filter-name>struts2</filter-name><filter-class>org.apache.struts2.dispatcher.FilterDispatcher</filter-class></filter><filter-mapping><filter-name>struts2</filter-name><

struts.xml报错

问题描述 报错:Thecontentofelementtype"interceptors"mustmatch"(interceptor|interceptor-stack)+"<packagename="struts"extends="struts-default"namespace="/qg"><interceptors><intercetorname="autho