• The Struts dispatcher cannot be found. This is usually caused by using Struts


    对于struts2中的问题:

    org.apache.jasper.JasperException: 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.
    org.apache.jasper.servlet.JspServletWrapper.handleJspException(JspServletWrapper.java:476)
    org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:389)
    org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:315)
    org.apache.jasper.servlet.JspServlet.service(JspServlet.java:265)
    javax.servlet.http.HttpServlet.service(HttpServlet.java:803)

    root cause

    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]
    org.apache.struts2.views.jsp.TagUtils.getStack(TagUtils.java:60)
    org.apache.struts2.views.jsp.StrutsBodyTagSupport.getStack(StrutsBodyTagSupport.java:52)
    org.apache.struts2.views.jsp.ComponentTagSupport.doStartTag(ComponentTagSupport.java:49)
    org.apache.jsp.login_jsp._jspx_meth_s_005ftextfield_005f0(login_jsp.java:106)
    org.apache.jsp.login_jsp._jspService(login_jsp.java:70)
    org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:98)
    javax.servlet.http.HttpServlet.service(HttpServlet.java:803)
    org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:328)
    org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:315)
    org.apache.jasper.servlet.JspServlet.service(JspServlet.java:265)
    javax.servlet.http.HttpServlet.service(HttpServlet.java:803)

    解决方案是:

    在web.xml页面中

    <filter-mapping>
    <filter-name>struts2</filter-name>
    <url-pattern>/*</url-pattern>
    </filter-mapping>

  • 相关阅读:
    2018-06-20 利用随机数组进行36选7(不重复)
    2018-06-20 js字符串函数
    2018-06-19 js DOM对象
    2018-06-19 Javascript 基础2
    《我们应当怎样做需求分析》阅读笔记
    《软件需求模式》阅读笔记03
    《软件需求模式》阅读笔记02
    《软件需求模式》阅读笔记01
    java总结:double取两位小数的多种方法
    梦断代码阅读笔记03
  • 原文地址:https://www.cnblogs.com/changna1314/p/6849319.html
Copyright © 2020-2023  润新知