`
Jerrick
  • 浏览: 19358 次
  • 性别: Icon_minigender_1
  • 来自: 北京
社区版块
存档分类

There is no Action mapped for namespace / and action name AjaxServlet. - [unknow

阅读更多

There is no Action mapped for namespace / and action name AjaxServlet. - [unknown location]

 

原因:web.xml中配置struts拦截为/*,AjaxServlet被拦截掉

<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>/*</url-pattern>
  </filter-mapping>

 

 <servlet>
    <description></description>
    <display-name>AjaxServlet</display-name>
    <servlet-name>AjaxServlet</servlet-name>
    <servlet-class>org.CollegePro.ssh.web.servlet.AjaxServlet</servlet-class>
  </servlet>
  <servlet-mapping>
    <servlet-name>AjaxServlet</servlet-name>
    <url-pattern>/AjaxServlet</url-pattern>
  </servlet-mapping>

 

解决办法:修改struts的过滤器设置,如下。只对.aciton结尾的请求和.jsp结尾请求过滤,这样就可以保证Ajax的过滤器能正常使用。

  <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>

分享到:
评论

相关推荐

    一个struts2的例子:彻底解决STRUTS2 错误There is no Action mapped for namespace / and action name login

    前几天在网上下载一个struts2的helloword的例子,那个作者也真够缺德的,搞个错误的程序,害得我查了一天的程序错误。 最后发现竟然是struts.xml被写成啦sturts.xml。 碰见这样的问题先鄙视下提供例子的作者, ...

    HTTP Status 404 - There is no Action

    HTTP Status 404 - There is no Action mapped for namespace and action name BackMemberGroupAudit..doc

    weblogic安装部署以及常见问题解决

    该文档对weblogic使用过程中,包括下载,安装,部署...6. weblogic部署war包action不能访问问题解决方法 [There is no Action mapped for namespace / and action name]. 5 7. java.lang.StackOverflowError. 5 等等

    解决使用struts2 时 访问web工程首页问题

    http://localhost:8080/ struts2会拦截,出现异常信息 There is no Action mapped for namespace / and action name.默认配置的welcomefile没有起作用。 按附件配置即可解决此问题

    servlet2.4doc

    Returns the servlet container attribute with the given name, or null if there is no attribute by that name. getAttribute(String) - Method in class javax.servlet.ServletRequestWrapper The default ...

    struts2 HelloWord例字

    在网上找了好个struts2的例子结果都不好使报There is no Action mapped for namespace / and action name这个错,没办法自己搞了个好用的,myeclipse 6.0 +tomcat5.5 + jdk 1.5 引入项目后直接发布就可以了!

    第14章:网络编程(day20).zip

    58:22,466 INFO ] org.springframework.context.support.AbstractApplicationContext.prepareRefresh(AbstractApplicationContext.java:511) - Refreshing WebApplicationContext for namespace 'hessian-servlet': ...

    cp201x资源启动程序

    Now make sure that this "ttyUSBx" is set as the destination port, baud rate is 115200, and 8N1 mode for minicom, by running the command 'minicom -s'. Note that running the "minicom -s" command as a ...

    S7A驱动720版本

    switch:&lt;DeviceName&gt; delivers the value 0, when the primary device is active and the value 1 when the backup device is active. For the place holder &lt;DeviceName&gt; in the I/O address the logical name ...

    EurekaLog_7.5.0.0_Enterprise

    17)..Added: Support for relative file paths and environment variables for events and various module paths 18)..Added: Logging in Manage tool 19)..Added: Windows 10 version detection 20)..Added: Stack ...

    struts_2.3.12GA_API文档(chm版本)

    Stops the action invocation immediately (by throwing a PauseException) and causes the action invocation to return the specified result, such as Action.SUCCESS, Action.INPUT, etc. void ...

    acpi控制笔记本风扇转速

    is larger than the largest known FADT version, and 2) if there is a mismatch between a 32-bit block address and the 64-bit X counterpart (when both are non-zero.) Example Code and Data Size: These ...

    Shader Sandwich

    Shader Sandwich is a layer based shader editor for Unity that allows you to create in an intuitive yet powerful environment, designed for artists rather than programmers. It comes with example ...

    leetcode伪代码-unique-morse-code-words:独特的莫尔斯电码词

    leetcode伪代码unique-morse-code-...[".-","-...","-.-.","-..",".","..-.","--.","....", "..",".---","-.-",".-..","--","-.","---",".--.","- -.-",".-.","...","-","..-","...-",".--","-..-","-. --","--.."]

    The Art of Assembly Language Programming

    Logical Operations on Bits 1.6 - Logical Operations on Binary Numbers and Bit Strings 1.7 - Signed and Unsigned Numbers 1.8 - Sign and Zero Extension 1.9 - Shifts and Rotates 1.10 - ...

    plib源代码(The PLIB Portable Interactive Applications Library distribution)

    SG -- Some Standard Geometry functions (vector and matrix math, spheres, boxes, frustra, etc) SL -- A Games-oriented Sound Library. FNT -- OpenGL texture-mapped font Library. PW -- A minimalist ...

    .NET4利用MemoryMappedFile实现跨进程多个可执行程序之间的通信

    基于.NET4.0的MemoryMappedFile实现共享内存通信 共享内存通信可以解决跨线程、跨进程、跨EXE之间通信的问题 对于需要传输图片等引用类数据,可以通过序列化和反序列化配合共享内存实现跨进程(跨EXE)通信 共享...

    SimIt-ARM-3.0 ARM指令模拟器

    After these steps, the ./build/bindirectory contains the following programs: ema An ARM interpreter. To test the installation was successful type ./build/bin/ema test/wc configure modifiy PATH ...

    Thinking in Java 4th Edition

    What is finalize() for? ............. 120 You must perform cleanup ......... 121 The termination condition ......... 121 How a garbage collector works .. 122 Member initialization ......... 125 ...

    TaskManager

    利用业余时间,写了个貌似windows自带的任务管理器(私下认为其功能更甚windows自带的)。 封装了许多API接口成为类(一些源自网络,一些自己封装),方便C++使用。但是对整个代码的设计比较烂,打算在学完设计模式...

Global site tag (gtag.js) - Google Analytics