写了一个JSP项目,在配置struts2时遇到了这个错误,在网上逛了一大圈后终于解决了这个问题。具体解决方法是:

1、struts.xml的名字和位置

这里特别提一点,很多人遇到这个错误都是名字错误,比如写成struts-login.xml但又没在web.xml中进行相关配置。struts.xml是struts2的默认配置名字所以不用再web.xml中配置。 第二点是位置问题,很多人说是放在src根目录下,其实不然,在部署后的web项目中是没有这个目录的试问struts2又怎么访问这个配置文件?正确的是放在WEB-INF/classes目录下,有些用myeclipse的朋友可能会说:“怎么我放在src目录下还是能运行呢?”这是因为IDE在部署项目时将struts.xml自动拷贝到了WEB-INF/classes下。我就是自己用ant完成这个拷贝步骤的。

2、Form表单

在表单中设置属性时如果使用的不是默认命名空间一定要声明。

3、struts.xml内容

一定要确认action的name属性填写无误,其实在一般的小型项目中使用默认命名空间就够了,不用设置namespace属性。此外一定要确认classes目录下有相应action的class类文件。

There is no Action mapped for namespace [/] and action name [login] associate解决办法 .的更多相关文章

  1. struts2中错误There is no Action mapped for namespace [/] and action name [] associated with context path

    1 There is no Action mapped for namespace [/] and action name [] associated with context path [/Stru ...

  2. Struts2中关于"There is no Action mapped for namespace / and action name"的总结

    今天在调试一个基础的Struts2框架小程序.总是提示"There is no Action mapped for namespace / and action name"的错误. ...

  3. 报错:HTTP Status 404 - There is no Action mapped for namespace [/] and action name [product-save] associated with context path [/20161101-struts2-2].

    运行:index.jsp---->input.jsp----->details.jsp,但是在input.jsp到details.jsp的时候报错误. 异常如下: 严重: Could no ...

  4. Struts2-tomcat报错:There is no Action mapped for namespace / and action

    HTTP Status 404 - There is no Action mapped for namespace / and action name first. type Status repor ...

  5. There is no Action mapped for namespace [/pages/action/student] and action name [findStudent]

    1.错误描写叙述 2014-7-13 2:38:54 org.apache.jasper.compiler.TldLocationsCache tldScanJar 信息: At least one ...

  6. There is no Action mapped for namespace / and action name UserAction

    果断收藏了,说的非常具体.刚開始学习的人常常遇到的问题. There is no Action mapped for namespace / and action name UserAction 在网 ...

  7. eclipse中配置struts2出现There is no Action mapped for namespace [/] and action name [Login] associated wi

    下午在eclipse中配置struts2时报: There is no Action mapped for namespace [/] and action name [Login] associat ...

  8. eclipse使用SSH框架出现There is no Action mapped for namespace [/] and action name [] associated with context path错误

    eclipse使用SSH框架出现There is no Action mapped for namespace [/] and action name [] associated with conte ...

  9. struts 2.5 There is no Action mapped for namespace [/] and action name [user_find] associated with context path [/struts2_crm].

    遇到了这个错误. There is no Action mapped for namespace [/] and action name [user_find] associated with con ...

  10. Could not find action or result: There is no Action mapped for namespace [/] and action name [GetG

    Could not find action or result: /car/GetGpsDataAction  There is no Action mapped for namespace [/] ...

随机推荐

  1. framework7 上拉加载一些ajax问题

    1.请求第一组数据后如果不能产生上拉进度条,则无法进行上拉加载. 解决办法:首次加载的数据量设置合理即可. 2.同一组数据请求多次,原因是异步刷新时间差,请求参数未更新,多次触发了上拉加载. 解决办法 ...

  2. QT_OPENGL-------- 5.model

    在qt中实现opengl obj模型导入: main.cpp #include<GL/glew.h> #include <GLFW/glfw3.h> #include<s ...

  3. 类的重载case2

    /*功能:类的成员属性和成员方法*/ public class Person{    public static void main(String args[]){        TruePerson ...

  4. Python copy(), deepcopy()

    copy() 浅拷贝: 创建一组拷贝对象的引用.切片操作相当于浅拷贝,会生成一个新的对象,新的对象里保存原对象的引用. 如果原对象中的可变对象改变(list),那么浅拷贝的对象随之改变,如果原对象中不 ...

  5. ocilib linux编译安装

    1.首先下载ocilib到自己目录 github:https://github.com/vrogier/ocilib 2.在下载instantclient 11.2.2的文件: instantclie ...

  6. H3C 主机单播IP包发送

  7. 阿里云ECS服务器活动99元一年,最高可买三年

    这几天阿里云 99一年.279三年的服务器活动如火如荼,和之前腾讯三年的服务器非常类似,非常低的价格换取非常高的价值,当然,通常情况下便宜没好货的,想要玩一下的老铁可以进阿里云去看看,阿里云270三年 ...

  8. 【原生JS】写最简单的图片轮播

    非常简单的一个大图轮播,通过将控制显示位置来进行轮播效果,写来给正在学习的新手朋友们参考交流. 先看效果:(实际效果没有这么快) 先看布局: <div id="display" ...

  9. functiils.lru_cache缩短递归时间

    力扣上看到一道题: 假设你正在爬楼梯.需要 n 阶你才能到达楼顶. 每次你可以爬 1 或 2 个台阶.你有多少种不同的方法可以爬到楼顶呢? 注意:给定 n 是一个正整数. 使用普通递归解决,超出时间限 ...

  10. C# 递归、try

    一.递归 递归:在函数体内调用本函数自身,直到符合某一条件不再继续调用 两个需要满足的条件1.有反复调用自身函数的过程2.有函数的出口:有不再继续执行的条件 例子: 案例: (一).输入正整数n,求n ...