• struts2错误:The Struts dispatcher cannot be found.


    struts2错误:The Struts dispatcher cannot be found.

    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.message._404_jsp._jspService(_404_jsp.java:159)
    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:377)

    解决办法:加了标签后,出现此问题
    其实最后只在原配置基础上加上.jsp过滤即可
     <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>*.action</url-pattern>
      </filter-mapping>
      
    <filter-mapping>
    <filter-name>struts2</filter-name>
    <url-pattern>*.jsp</url-pattern>
    </filter-mapping>

  • 相关阅读:
    centos免密码登录
    conda3 快速下载python包
    Flink问题及解决方案
    git把项目推送到不同的remote(git地址)
    选择器提取内容
    spark写入mysql
    flume简介及netcat样例
    Spark 读取 Hbase 优化 --手动划分 region 提高并行数
    shell grep正则表达式
    Hibernate持久化
  • 原文地址:https://www.cnblogs.com/yigerendehaibian/p/3152181.html
Copyright © 2020-2023  润新知