宇宙短视频:There is no Action mapped for namespace / and action name
来源:百度文库 编辑:偶看新闻 时间:2024/05/17 01:00:52
文章出处:http://hi.baidu.com/56840725/blog/item/aba7c744574c7f3886947315.html
struts2的异常There is no Action mapped for namespace / and action name --转
2009-01-19 00:28
把 package 元素里的 namespace 去掉.
调用 action 名称的页面应该放在 namespace 的名称里面(文件夹,路径)
/example/HelloWorld.jsp
HelloWorld.jsp 文件应该放在 namespace="/example" example 文件夹里面. 否则调用 action 会出错.
关于 namespace :
struts.xml 文件中 package 元素下 namespace 属性的作用
说在前面的话:
namespace的作用是控制相应package下的action的url地址,url地址在web编程中是基础中的基础. 我们的程序不同的功能实际上就是对相应url地址的访问来触发的,这个要牢牢掌握,有点象java的classpath
原文: http://www.blogjava.net/Unmi/archive/2008/05/26/203014.html
Struts2 的 struts.xml 中是分 package 配置的,可以为 package 设置 namespace 属性,如
......
如果没有指定 namespace 属性,默认 namespace 是 ""。使用 namespace 可以方便于按不同目的规划对应用的访问规则。比如不同 namespace 下配置了不同的拦截器就可以实现权限的控制,如 "/secure" 下已登陆用户才能访问,"/public" 下可公开访问的。
配置了 namespace 直接就是反应在访问 URL 上,例如 namespace="/secure" name="test" 的 action
访问它的 URL 就是http://ip:port/context/secure/test.action,那如果在 namespace "/secure" 下没有 test action 会出现什么情况呢?Struts 还会尝试在默认 namespace,即 "" 下找 test。
再举个例子,URL 是http://ip:port/context/some/path/test.action 时,如果在 "/some/path" namespace 下找不到 test action,也是到 "" (default namespace) 下找 test action,但不会去 "/some" 下找的。
用标签 对应页面源文件是 /context/secure/test.action
稍有麻的就是但是后台会有警告:
警告: No configuration found for the specified action: '/secure/test.action' in namespace: ''. Form action defaulting to 'action' attribute's literal value.
Struts2 把 action 属性值当整一个 Action Name 了,但这也不影响使用,这个 URL 正好能与 (package namespace) + (action name) 合上拍。
但是对于使用了动态方法调用(struts.enable.DynamicMethodInvocation = true)就没这么幸运了。很容易想当然的
同时后台的警告信息是:
警告: No configuration found for the specified action: '/secure/test' in namespace: ''. Form action defaulting to 'action' attribute's literal value.
很显然对于这个 action="/TestStruts2/om/test",提交时是会得到 HTTP Status 404 - /context/secure/test 错误。
正确的用法是 也有一个 namespace 属性,对了,就是
生成的 HTML 源文件是:
struts2的异常There is no Action mapped for namespace / and action name --转
2009-01-19 00:28
把 package 元素里的 namespace 去掉.
调用 action 名称的页面应该放在 namespace 的名称里面(文件夹,路径)
HelloWorld.jsp 文件应该放在 namespace="/example" example 文件夹里面. 否则调用 action 会出错.
关于 namespace :
struts.xml 文件中 package 元素下 namespace 属性的作用
说在前面的话:
namespace的作用是控制相应package下的action的url地址,url地址在web编程中是基础中的基础. 我们的程序不同的功能实际上就是对相应url地址的访问来触发的,这个要牢牢掌握,有点象java的classpath
原文: http://www.blogjava.net/Unmi/archive/2008/05/26/203014.html
Struts2 的 struts.xml 中是分 package 配置的,可以为 package 设置 namespace 属性,如
......
如果没有指定 namespace 属性,默认 namespace 是 ""。使用 namespace 可以方便于按不同目的规划对应用的访问规则。比如不同 namespace 下配置了不同的拦截器就可以实现权限的控制,如 "/secure" 下已登陆用户才能访问,"/public" 下可公开访问的。
配置了 namespace 直接就是反应在访问 URL 上,例如 namespace="/secure" name="test" 的 action
访问它的 URL 就是http://ip:port/context/secure/test.action,那如果在 namespace "/secure" 下没有 test action 会出现什么情况呢?Struts 还会尝试在默认 namespace,即 "" 下找 test。
再举个例子,URL 是http://ip:port/context/some/path/test.action 时,如果在 "/some/path" namespace 下找不到 test action,也是到 "" (default namespace) 下找 test action,但不会去 "/some" 下找的。
用标签
稍有麻的就是
警告: No configuration found for the specified action: '/secure/test.action' in namespace: ''. Form action defaulting to 'action' attribute's literal value.
Struts2 把 action 属性值当整一个 Action Name 了,但这也不影响使用,这个 URL 正好能与 (package namespace) + (action name) 合上拍。
但是对于使用了动态方法调用(struts.enable.DynamicMethodInvocation = true)就没这么幸运了。很容易想当然的
警告: No configuration found for the specified action: '/secure/test' in namespace: ''. Form action defaulting to 'action' attribute's literal value.
很显然对于这个 action="/TestStruts2/om/test",提交时是会得到 HTTP Status 404 - /context/secure/test 错误。
正确的用法是
no one is there
There is no telling是什么意思?
i'm afraid there is ____for all of us.A.no big enough room B. no room big enough
i'm afraid there is ____for all of us.A.no big enough room B. no room big enough
no one is there 的歌词谁有啊
There is no royar to learn 是什么意思
no-one is there是谁唱的??
There is no mother_____loves her children.
There is no royal road to leaning
there is no enough ___for another desk
There is no use ....的用法,谢谢
37.We all know the fact ___ there is no air or water, there no life。
请问there is no such user什么意思啊
There is no de fault printer selected currently?是什么意思
选择题There is no ( )about when they will leave.
there is no dictionary____ you can find everything
这句话There is no royar to learn 是什么意思
___we know,there is no life on the moon.
There is no such file, check up path.. 时,怎么办
"There is No Better than "Here"
I am afraid there is no one more
there is no douubt是固定词组吗?
There is no such thing as fate. 英文辩论题!
There is no olefault printer curr ently selected!