There is no Action mapped for namespace [/] and action name [login] associate解决办法 .
写了一个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解决办法 .的更多相关文章
- 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 ...
- Struts2中关于"There is no Action mapped for namespace / and action name"的总结
今天在调试一个基础的Struts2框架小程序.总是提示"There is no Action mapped for namespace / and action name"的错误. ...
- 报错: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 ...
- 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 ...
- 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 ...
- There is no Action mapped for namespace / and action name UserAction
果断收藏了,说的非常具体.刚開始学习的人常常遇到的问题. There is no Action mapped for namespace / and action name UserAction 在网 ...
- 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 ...
- 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 ...
- 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 ...
- 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 [/] ...
随机推荐
- 《mysql必知必会》4笔记(存储过程、游标、触发器、事务、全球化本地化、权限、数据库维护、性能)
二十三:使用存储过程: 1:mysql 5添加了对存储过程的支持.很多时候,一个完整的操作需要多条语句才能完成.存储过程简单来说,就是为以后的使用而保存的一条或多条mysql语句的集合,可将其视为批文 ...
- python世界里的局部变量和全局变量: 潜规则太重要了!!!
python世界里的局部变量和全局变量: 潜规则太重要了!!! 先上代码: def fun(): def test_global(): ''' 内层和外层都需要声明为global, 才能彻底打通变量名 ...
- Python traceback模块简单使用
Python中的traceback模块被用于跟踪异常返回信息,可以在logging中记录下traceback. traceback.format_exc() 获取异常为字符串,保存到日志文件 try: ...
- MongoDB -- JAVA基本API操作
package com.example.mongodb.mongodb.demo; import com.mongodb.MongoClient; import com.mongodb.client. ...
- javascript简介 标签: javascript 2015-11-13 12:13 1712人阅读 评论(39)
JavaScript是一种属于网络的脚本语言,已经被广泛用于Web应用开发,常用来为网页添加各式各样的动态功能,为用户提供更流畅美观的浏览效果.通常JavaScript脚本是通过嵌入在HTML中来实现 ...
- How to use AutoMapper
http://docs.automapper.org/en/stable/Getting-started.html IMappingExpression<TSource, TDestinatio ...
- js+canvas五子棋人机大战ai算法
<!DOCTYPE html> <html> <head> <meta charset="UTF-8"> <title> ...
- Python 3.7.0 For Mac版软件安装教程附下载地址
https://www.jianshu.com/p/f02d6f01eba7
- [转]Spring历史版本变迁和如今的生态帝国
前两篇: 为什么要有Spring? 为什么要有Spring AOP? 前两篇从Web开发史的角度介绍了我们在开发的时候遇到的一个个坑,然后一步步衍生出Spring Ioc和Spring AOP的概念雏 ...
- HDU 5463
题意:一个盒子有36个格子.每个格子可以装64个物品,搬运一个箱子是一次搬运,问最少到搬运次数 思路:直接求总需要多少个格子,然后去求盒子,这里求盒子呢有个小技巧,就是用ceil函数 #include ...