zoukankan      html  css  js  c++  java
  • 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> 


  • 相关阅读:
    Tensorflow笔记:反向传播,搭建神经网络的八股,(损失函数loss,均方误差MSE,反向传播训练方法,学习率)
    Tensorflow笔记:神经网络的参数,神经网络的搭建,神经网络的前向传播
    Tensorflow笔记:tensorflow 的基本概念(张量,数据类型,计算图,会话)
    PAT (Advanced Level) Practice 1001 A+B Format
    深度学习Tensorflow 之 MNIST手写数字识别
    MNIST数据集介绍及读取
    深度学习Tensorflow非线性回归案列
    TensorFlow 完整的TensorFlow入门教程
    centos7 解决下载速度慢的问题
    Structs复习 ActionMethod
  • 原文地址:https://www.cnblogs.com/xiaowangba/p/6314278.html
Copyright © 2011-2022 走看看