警告: No configuration found for the specified action: 'login' in namespace: '/jsp'. Form action defaulting to 'action' attribute's literal value.
因为这个错误我在 struts.xml 和 jsp页面之间修改了4个小时,不过最后我搞定他了。
虽然我还不明白原理是为什么,但并不妨碍我把这个可恶问题的解决过程同大家分享。
1.先把struts.xml 写成最简单的格式。
<package name="default" extends="struts-default">
<action name="login" class="com.action.LoginAction">
<result name="success"> /jsp/welcome.jsp </result>
</action>
</package>
-------------------
2.其次把 login.jsp 也改成最简单的格式。
<body>
<s:form action="login" method="post">
<s:textfield name="userName" label= "用户名"> </s:textfield>
<s:textfield name="password" label= "密码"> </s:textfield>
<s:submit/>
</s:form>
</body>
现在我们可以重启服务了,应该不会再出现问题了。
可是!我如果必须加上 namespace 那又该如何做呢?
--------------------
3.在struts.xml 中加入 namespace="/xxx" 为什么要加3个X 呢 ?那是真的恨呀......
那么要正确的运行你必须在 login.jsp 里写
<s:form action="login" method="post" namespace="/xxx">
重启-运行;应该不会再有问题的。
但是如果你写成 <s:form action="/xxx/login.action" method="post">
依然会出错的,这点我就不明白了哈。
-------------------
4.最后我们再来看一下 这段错误
警告: No configuration found for the specified action: 'login' in namespace: '/jsp'. Form action defaulting to 'action' attribute's literal value.
当我把 login.jsp 中的 action 值的变化为啥时 'login' 也就变化成啥
当我改变 login.jsp 的目录时, '/jsp' 就会改变 比如 WebRoot/jsp/xjsp/login.jsp
那么就是 '/xjsp/jsp'.Form action defaulting .......
----------------
我还不知道如何能能代码像其它人样子贴出来 就像是在编辑器中的效果一样咯。(有谁知道的留言帮我一下哦)
所以看起来很不方便,希望能给痛苦中的人们一些用处哦哦
分享到:
相关推荐
- Minor changes to the No operation error watchdog timer for the CD and Hard disk tests. - Minor correction to the Butterfly seek test. - Video playback trace logging increased. Release 5.3 build ...
2. **警告:No configuration found for the specified action: 'sum.action' in namespace: ''** 这个警告通常是因为Struts2找不到指定的Action。如果在JSP中使用 `<s:form action=”sum.action”>`,对应的源文件...
Fundamentals of the JavaMail API Presented by developerWorks, your source for great tutorials ibm.com/developerWorks Table of Contents If you're viewing this document online, you can click ...
o Added option to scan only emails with the specified 'From' and 'To' strings. * Version 1.82 o When adding a folder to scan (with the Add button), the folder path in now delimited with quotes, ...
When /P is specified, the EGA palette will be restored each time the screen is swapped. In general, you don't need to use this switch unless your program modifies the EGA palette registers, or ...
When /P is specified, the EGA palette will be restored each time the screen is swapped. In general, you don't need to use this switch unless your program modifies the EGA palette registers, or ...
- FIX: In "Windows ClearType" font rendering mode (OS Windows mode) the "garbage" pixels can appear from the right and from the bottom sides of the painted rectangle of the TFlexText object....
: No configuration found for the specified action: 'fileUpLoad.action' in namespace: '/manager'. Form action defaulting to 'action' attribute's literal value. ``` **知识点解释:** 1. **问题描述:** ...
For this reason, the functions that handle these actions offer the option of waiting until the action is complete before returning (so-called synchronous operation); although they can be called in an ...
Please see the actual settings later in the document for more details as to why ; we recommend these changes in PHP's behavior. ; display_errors ; Default Value: On ; Development Value: On ; ...
Fixed the found code dialog count size Fixed mono freezing Cheat Engine when it crashes/freezes Additions and changes: Changed the processlist and added an Applications view similar to the ...