struts2常见配置解决错误There is no mapped for namespace[/] and action name
2018-02-04 13:19
555 查看
解决struts配置问题:
关于这个错误,很多人遇到过。这里给大家推荐一种正确配置,杜绝出现这个错误。我们知道Struts框架具有包和命名空间,目的是防止同名action干扰,所以用包权限来区分。一般的action不会重名,但是在放置后台管理员界面和前端界面都涉及到action的话,这时候包权限显得有必要。配置不成功八成会报下面的错误下面这个错误,咱们现在要解决这个问题。
解决办法:
一:填写命名空间,建议与包名相同。当然单独填写" / "也可以,但是此时必须重启server服务器,不然不会生效。二:把jsp放在包下。不同权限的访问建议分别建包。有多少包建立多少struts包。比如前端和后台jsp界面。建立admin和forw两包即可,其他为该包的子包。
三:jsp访问路径填写比如http://localhost:8002/strutstest/admin/login.jsp,也就是jsp的路径。action接口路径标准写法:http://localhost:8002/strutstest/admin/login.action?action=login&username=790710371&userpassword=123,也就是http://ip:端口/项目名/命名空间+xxxx.action?login=xxx+参数对。
web.xml填写核心过滤器:下面是简单配置,具体的是动态action还需要另行配置,本文不多说。
<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>
相关文章推荐
- 解决STRUTS2 错误 There is no Action mapped for namespace / and action name
- 彻底解决STRUTS2 错误There is no Action mapped for namespace / and action name login
- Struts2中关于"There is no Action mapped for namespace / and action name"的错误解决
- eclipse中配置struts2出现There is no Action mapped for namespace [/] and action name...
- struts2中错误提示:There is no Action mapped for namespace / and action name
- 关于struts2总是报There is no Action mapped for namespace / and action name login错误的一点经验
- struts2关于"There is no Action mapped for namespace / and action name"的解决方法
- struts2提示“There is no Action mapped for namespace [/] and action name [XXX]... ”错误的解决办法
- Struts应用出现的错误及解决方法:There is no Action mapped for namespace / and action name login
- struts2配置错误 There is no Action mapped for namespace [/] and action name [] associated with context
- Struts2中关于"There is no Action mapped for namespace / and action name"错误
- 关于Struts2中的错误:例如There is no Action mapped for namespace / and action name product-input.
- 解决Struts2报"There is no Action mapped for namespace / and action name"错误
- Struts2中关于"There is no Action mapped for namespace / and action name"的总结
- Struts2中关于"There is no Action mapped for namespace / and action name"的总结
- Struts2:HTTP Status 404 - There is no Action mapped for namespace[ / ]and action name singleUpload.
- There is no Action mapped for namespace / and action name login.的解决
- Struts2中关于"There is no Action mapped for namespace / and action name"的总结
- There is no Action mapped for namespace / and action name 问题的解决办法
- 新手学习Struts2遇到的问题:There is no Action mapped for namespace / and action name . - [unknown location]