JSP 不能用 不支持 STRUTS标签 报错 The Struts dispatcher cannot be found.
servlet.service() for servlet 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.jer.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) www.2cto.com
at org.apache.tomcat.util.net.aprendpoint$worker.run(aprendpoint.java:1509)
at java.lang.thread.run(thread.java:619)
其实 好办,只要在web.xml中加入一个过滤器就行了:
[html]
<span style="font-size:18px;"><filter-mapping>
<filter-name>struts2</filter-name>
<url-pattern>*.jsp</url-pattern>
</filter-mapping> </span>
上一篇: 用按钮调用jsp代码怎么写?
下一篇: JSP技术中的开发自定义标签