`
tongjun_zhou
  • 浏览: 27794 次
  • 性别: Icon_minigender_1
社区版块
存档分类
最新评论

There is no Action mapped for action name TestAction

阅读更多
There is no Action mapped for action name test. - [unknown location]
at com.opensymphony.xwork2.DefaultActionProxy.prepare(DefaultActionProxy.java:185)
at org.apache.struts2.impl.StrutsActionProxy.prepare(StrutsActionProxy.java:61)
at org.apache.struts2.impl.StrutsActionProxyFactory.createActionProxy(StrutsActionProxyFactory.java:39)
at com.opensymphony.xwork2.DefaultActionProxyFactory.createActionProxy(DefaultActionProxyFactory.java:58)
at org.apache.struts2.dispatcher.Dispatcher.serviceAction(Dispatcher.java:488)
at org.apache.struts2.dispatcher.FilterDispatcher.doFilter(FilterDispatcher.java:434)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:235)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:233)
at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:191)
at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:128)
at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:102)
at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:109)
at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:293)
at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:849)
at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.process(Http11Protocol.java:583)
at org.apache.tomcat.util.net.JIoEndpoint$Worker.run(JIoEndpoint.java:454)
at java.lang.Thread.run(Thread.java:662)

搞来半天错在web.xml 头文件

1、错误的web.xml
  <?xml version="1.0" encoding="ISO-8859-1"?>
<!DOCTYPE web-app PUBLIC "-//Sun Microsystems, Inc.//DTD Web Application 2.3//EN" "http://java.sun.com/dtd/web-app_2_3.dtd">
<web-app>
    <display-name>Struts 2.0 Hello World</display-name>
    <filter>
        <filter-name>struts2</filter-name>     
          <filter-class>org.apache.struts2.dispatcher.FilterDispatcher</filter-class>
           <init-param>
     <param-name>config</param-name>
      <param-value>struts-default.xml,WebRoot/WEB-INF/struts.xml</param-value>
  </init-param>
    </filter>
    <filter-mapping>
        <filter-name>struts2</filter-name>
        <url-pattern>/*</url-pattern>
    </filter-mapping>
    <welcome-file-list>
        <welcome-file>index.jsp</welcome-file>
    </welcome-file-list>
</web-app>

2、正确的web.xml

<?xml version="1.0" encoding="UTF-8"?>
<web-app version="2.5" xmlns="http://java.sun.com/xml/ns/javaee"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://java.sun.com/xml/ns/javaee
http://java.sun.com/xml/ns/javaee/web-app_2_5.xsd">
    <display-name>Struts 2.0 Hello World</display-name>
    <filter>
        <filter-name>struts2</filter-name>     
          <filter-class>org.apache.struts2.dispatcher.FilterDispatcher</filter-class>
    </filter>
    <filter-mapping>
        <filter-name>struts2</filter-name>
        <url-pattern>/*</url-pattern>
    </filter-mapping>
    <welcome-file-list>
        <welcome-file>index.jsp</welcome-file>
    </welcome-file-list>
</web-app>
分享到:
评论

相关推荐

    一个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”。这个问题通常出现...

    struts2教程-学习笔记.zip

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

    struts2 HelloWord例字

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

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

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

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

    错误信息通常为:“There is no Action mapped for namespace / and action name.”,这意味着Struts2在尝试处理请求时找不到对应的Action映射。此外,如果设置了默认的欢迎页面(welcome file),但在启动应用后...

    Memory-Mapped Files for Qualcomm Brew

    ### Memory-Mapped Files for Qualcomm Brew #### 作者:Ray Rischpater 在现代无线手持设备的开发过程中,内存管理始终是一项重要的考虑因素。尽管近年来移动设备的内存容量有了显著提升,但有效的内存管理和利用...

    struts2 的异常收集

    HTTPStatus 404 - There is no Action mapped for namespace [/] and action name [user_login] ``` 这通常意味着在`struts.xml`中未为指定的动作名和命名空间配置对应的Action处理类。解决这一问题的关键在于确保...

    MemoryMappedFile 使用 共享内存循环读写

    MemoryMappedFile 使用 C# 内存中分配一大块地址. 前边分配一个用与共同配置用 后边N个结构体 for循环建 一般用到此问题,两本程序 一个读一个写 循环读写 ----2015/09/24 Lyndon 上海----

    mappedBy属性:one2many

    在处理一对多(One-to-Many)关系时,`mappedBy`属性扮演了关键角色。这篇博客文章,虽然描述为空,但链接指向了一个可能深入讨论`mappedBy`特性的资源。 `mappedBy`属性是Hibernate中用于定义关联关系的一个关键...

    Struts2深刻理解所记的笔记

    这有时会导致找不到Action的错误,如"There is no Action mapped for namespace/and action name Login.",需确保在web.xml中正确配置Struts2的FilterDispatcher以加载这些资源。 2. **UI组件与模板引擎**:为了...

    MDB: A Memory-Mapped Database and Backend for OpenLDAP

    本文主要介绍了一种名为MDB(Memory-Mapped Database)的读优化数据库库及其作为OpenLDAP后端的应用。该技术由Howard Chu开发,并在Symas Corp.以及OpenLDAP项目中得到应用。MDB作为一种专门为OpenLDAP设计的内存...

    微软内部资料-SQL性能优化2

    To reserve or commit memory and unintentionally not release it when it is no longer being used. A process can leak resources such as process memory, pool memory, user and GDI objects, handles, threads...

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

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

    SSD7 选择题。Multiple-Choice

    When mapping from an ER model to a relational model, a strong entity is mapped into a (a) table (b) row (c) column (d) key Correct answer is (a) 10. Which of the following is true about ...

    struts2.5+框架使用通配符与动态方法常见问题小结

    * There is no Action mapped for namespace [/] and action name [test-update] associated with context path [/Struts2_01]. 这些错误提示通常是由于映射问题引起的。解决这些问题的步骤是: 1. 先排查访问的...

    Qemu-1.0.1 for windows

    'disk_image' is a raw hard disk image for IDE hard disk 0 Standard options: -h or -help display this help and exit -version display version information and exit -machine [type=]name[,prop[=value][,.....

    外文翻译 stus MVC

    There is no flow logic, no business logic, and no model information -- just tags. Tags are one of the things that make Struts unique compared to other frameworks like Velocity. Note: "Think thin" ...

Global site tag (gtag.js) - Google Analytics