`

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

阅读更多

 

异常分析:以上的配置及文件中,如果采用 http://ip:port/SayHello.jsp,那么会出现前面所提到的异常。如果采用http://ip:port/SayHello.action 进行访问,那么正常。

 原因:如果想要在jsp文件中,采用 struts的tag,那么必须通过web.xml所配置的过滤器访问文件,否              则会有异常,即 之前所出现的异常。

解决方案:

       方案一:

              采用 http://ip:port/SayHello.action 访问

      方案二:

             将web.xml 的过滤器,从 *.action 修改为: /*

      方案三:

             修改SayHello.jsp 文件,不使用 struts 的标签。

<!--EndFragment-->

 

我最终采取方案如下: 在web.xml中如下配置

1.The Struts dispatcher cannot be found.  This is usually caused by using Struts tags without the associated filter. Strut   
2.s tags are only usable when the request has passed through its servlet filter, which initializes the Struts dispatcher n   
3.eeded for this tag. - [unknown location] 

解决: 
web.xml 中添加一个filter 
 <filter-mapping> 
<filter-name>struts2</filter-name> 
<url-pattern>*.jsp</url-pattern> 
</filter-mapping> 
<filter-mapping> 
<filter-name>struts2</filter-name> 
<url-pattern>/action/*</url-pattern> 
</filter-mapping> 

分享到:
评论

相关推荐

    org.apache.struts2.dispatcher.FilterDispatcher

    org.apache.struts2.dispatcher.FilterDispatcher

    struts2上传必备jar包,避免出现struts2的升级漏洞!自己吃亏后分享

    at org.apache.struts2.dispatcher.Dispatcher.cleanUpRequest(Dispatcher.java:837) at org.apache.struts2.dispatcher.ng.PrepareOperations.cleanupRequest(PrepareOperations.java:103) at org.apache.struts2....

    struts 2.2 api文档

    org.apache.struts2.dispatcher.ng, org.apache.struts2.dispatcher.ng.filter, org.apache.struts2.dispatcher.ng.listener, org.apache.struts2.dispatcher.ng.servlet, org.apache.struts2.impl, org.apache....

    Struts课堂笔记.rar--struts2的struts.properties配置文件详解

    The org.apache.struts2.dispatcher.multipart.MultiPartRequest parser implementation for a multipart request (file upload) 专为multipart请求信息使用的org.apache.struts2.dispatcher.multipart....

    struts 2.3.4.1 最新英文版API

    org.apache.struts2.dispatcher.ng This package contains a reimagining of the traditional Struts filter dispatchers. org.apache.struts2.dispatcher.ng.filter org.apache.struts2.dispatcher.ng.listener ...

    struts2的struts.properties配置文件详解

    9. struts.dispatcher.parametersWorkaround:这是一个布尔值,用于确定是否使用Servlet请求参数工作区(PARAMETERSWORKAROUND),该工作区用于某些版本的WebLogic。 10. struts.enable.DynamicMethodInvocation:...

    tomcat报错Unable to find 'struts multipart saveDir解决

    tomcat报错Unable to find 'struts multipart saveDir解决

    Struts2.5.2的配置及问题解决

    针对Struts2.5.2最新版本的配置进行了梳理,通过一步步的步骤和发生的问题点的解决,完成对Struts2.5.2的配置。

    Struts2入门教程(全新完整版)

    org.apache.struts2.dispatcher.ServletActionRedirectResult 16 plainText 16 显示源文件内容,如文件源码 16 org.apache.struts2.dispatcher.PlainTextResult 16 freemarker 16 处理FreeMarker模板 16 org.apache....

    Struts2上传所需jar包

    by You to the Licensor shall be under the terms and conditions of this License, without any additional terms or conditions. Notwithstanding the above, nothing herein shall supersede or modify the ...

    新struts2+jQuery所需包.rar

    &lt;filter-class&gt;org.apache.struts2.dispatcher.FilterDispatcher, 新版本中都是过时的了,采取该过滤器, &lt;filter-class&gt;org.apache.struts2.dispatcher.ng.filter.StrutsPrepareAndExecuteFilter。

    Apache的Struts2框架严重安全漏洞

    Apache的Struts2框架最近出了一个很严重的漏洞,可以直接执行系统命令 http://www.163.com?%28%27\u0023_memberAccess[\%27allowStaticMethodAccess\%27]%27%29%28meh%29=true&%28aaa%29%28%28%27\u0023context[\%27...

    struts-2.3.33-lib.zip

    struts2官网2.3版本的最后一个版本,能够...注意此版本的dispatcher是org.apache.struts2.dispatcher.ng.filter.StrutsPrepareAndExecuteFilter。详见https://struts.apache.org/docs/struts-23-to-25-migration.html。

    Struts2_s2-016&017&ognl2.6.11_patch漏洞补丁

    &lt;bean type="org.apache.struts2.dispatcher.mapper.ActionMapper" name="myDefaultActionMapper" class="com.struts2.MyDefaultActionMapper" /&gt; &lt;constant name="struts.mapper.class" value=...

    解决struts2下载异常的jar包 struts2-sunspoter-stream-1.0.jar

    at javax.servlet.http.HttpServletResponseWrapper.sendError(HttpServletResponseWrapper.java:108) at org.apache.struts2.dispatcher.Dispatcher.sendError(Dispatcher.java:770) at org.apache.struts2....

    Struts2属性文件详解

    struts.diSPAtcher.parametersWorkaround 对于某些Java EE服务器,不支持HttpServlet Request调用getParameterMap()方法,此时可以设置该属性值为true来解决该问题.该属性的默认值是false.对于 WebLogic、Orion和OC4J...

    传智播客struts2全程学习笔记

    传智播客struts2开源框架全程跟踪学习笔记,可以有效的提高对struts2框架的新认识和使用,更有效的提高开发效率!

    strust拦截器小例子

    用简单的例子演示了拦截器的使用,适合初学者参考

    第一个struts程序

    org.apache.struts2.dispatcher.FilterDispatcher dispatcher这个单词写错了。 3、LoginAction.java这个文件中的方法写错了。public String execute(),excecute这个单词写错了。 4、struts.xml中的...

    struts-2.5.13

    &lt;filter-class&gt;org.apache.struts2.dispatcher.filter.StrutsPrepareAndExecuteFilter&lt;/filter-class&gt; &lt;!-- 引用个具体类文件 --&gt; &lt;/filter&gt; &lt;filter-mapping&gt; &lt;filter-name&gt;struts2&lt;/filter-name&gt; ...

Global site tag (gtag.js) - Google Analytics