`
Jerrick
  • 浏览: 19780 次
  • 性别: 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

    在Web开发中,尤其是使用基于Java的Web框架如Struts时,开发者可能会遇到一个常见的问题:“HTTP Status 404 - There is no Action mapped for namespace and action name BackMemberGroupAudit”。这个问题通常出现...

    Unix Commands (Aix Freebsd Hpux Linux Solaris & Tru64)

    Understanding these differences and similarities is essential for managing users and files effectively across different Unix systems. Administrators should refer to specific documentation or manuals ...

    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 引入项目后直接发布就可以了!

    hibernate_reference.pdf

    This includes specifying the table name, column names, and other details required for the mapping. - **Hibernate Configuration**: You'll set up the `hibernate.cfg.xml` file, which contains essential ...

    计算机组成与结构体系英文课件:Chapter3 BasicInputOutput.pdf

    - In this approach, I/O devices and memory share the same address space, meaning that no special commands are needed for I/O operations. Instead, I/O operations resemble memory reads and writes. - ...

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

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

    spring实例“Developing_a_Spring_Framework_MVC_application_step-by-step”_剖析

    &lt;servlet-name&gt;springapp&lt;/servlet-name&gt; &lt;servlet-class&gt;org.springframework.web.servlet.DispatcherServlet&lt;/servlet-class&gt; &lt;load-on-startup&gt;1&lt;/load-on-startup&gt; &lt;/servlet&gt; &lt;servlet-mapping&gt; &lt;servlet...

    HX8357-A01_T_DS_v03_090520.pdf

    The HX8357-A01(T) is a high-performance TFT (Thin Film Transistor) mobile single chip driver designed for driving 320RGB x 480 dot displays with 262K colors and an internal GRAM (Graphics RAM)....

    HX8340-B_V01_20071203.pdf

    The HX8340-B(T) is designed to be compact and efficient, making it suitable for mobile devices where space is limited. #### 2. Features The key features of the HX8340-B(T) include: - **Support for ...

    struts 中遇到的常见问题 解决,你还在痛苦中吗

    本文将针对其中一种常见的错误提示:“There is no Action mapped for namespace / and action name”进行深入分析,并给出相应的解决方法。 #### 二、问题描述 当在使用 Struts 框架开发 Web 应用时,如果配置...

    struts2教程-学习笔记.zip

    "There is no Action mapped for namespace and action name错误的解决方法.txt"文档可能详细解释了这个问题的成因,如配置错误、Action类未正确指定、或者struts.properties或struts.xml配置文件中的条目缺失。...

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

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

    P25Q40H.pdf

    - **Address Mapping** (Page 20): Provides details on how addresses are mapped to the memory locations, including sector and page boundaries. #### Device Operation: - **Device Operations** (Page 22): ...

    Life After BerkeleyDB- OpenLDAP's Memory-Mapped Database

    - **Direct Access to Memory**: The entire database is mapped into virtual memory, and all data fetches are performed through direct access to the mapped memory instead of using intermediate buffers or...

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

    web.xml详解(web-app_2_3.dtd)

    ELEMENT servlet (servlet-name, servlet-class, init-param*, load-on-startup?, description?)&gt; &lt;!ELEMENT servlet-name (#PCDATA)&gt; &lt;!ELEMENT servlet-class (#PCDATA)&gt; &lt;!ELEMENT init-param (param-name, param...

    jz4760 program manual

    - **GP_DMA (General Purpose Direct Memory Access)**: GP_DMA is a mechanism for direct memory access, allowing efficient data transfer between memory and peripherals. - **Video Acceleration Block**: ...

Global site tag (gtag.js) - Google Analytics