No configuration found for the specified action警告异常的解决方案
来源:互联网 发布:ubuntu安装源位置 编辑:程序博客网 时间:2024/05/16 00:32
异常信息如下:
2015-7-15 11:52:36 com.opensymphony.xwork2.util.logging.commons.CommonsLogger warn
警告: No configuration found for the specified action: 'Login' in namespace: '/admin'. Form action defaulting to 'action' attribute's literal value.
2015-7-15 11:52:36 com.opensymphony.xwork2.util.logging.commons.CommonsLogger warn
警告: No configuration found for the specified action: 'Login' in namespace: '/admin'. Form action defaulting to 'action' attribute's literal value.
出现这类异常的通常情况是struts.xml和你的jsp页面的namespace不对应。
我的struts.xml文档如下:
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE struts PUBLIC "-//Apache Software Foundation//DTD Struts Configuration 2.0//EN" "http://struts.apache.org/dtds/struts-2.0.dtd">
<struts>
<package name="struts2" namespace="/" extends="struts-default">
<action name="Login" class="UserAction" method="login">
<result name="admin" type="redirectAction">ListUsers</result>
<result name="user">/global/success.jsp</result>
<result name="failure">/global/failure.jsp</result>
<result name="input">/index.jsp</result>
</action>
<action name="Register" class="UserAction" method="addUser">
<result type="redirect">/users/register.jsp</result>
<result name="addSuccess">/global/success.jsp</result>
<result name="addFailure">/global/failure.jsp</result>
</action>
<action name="ListUsers" class="UserAction" method="queryAllUser">
<result name="success">/admin/listUsers.jsp</result>
</action>
<action name="DeleteUser" class="UserAction" method="deleteUser">
<result name="success">/global/success.jsp</result>
<result name="input">/global/failure.jsp</result>
</action>
<action name="EditUser" class="UserAction" method="editUser">
<result name="success">/global/success.jsp</result>
<result name="input">/global/failure.jsp</result>
</action>
<action name="QueryById" class="UserAction" method="queryUserById">
<result>/admin/editUser.jsp</result>
</action>
</package>
</struts>
发生异常的jsp代码片段:
<s:form name="form1" action="Login" method="post" onsubmit="return checkLogin()">
<div><s:textfield id="userName" name="user.userName" label="用户名"/><s:label id="userMsg"/></div>
<div><s:password id="password" name="user.password" label="密码"/> <s:label id="pwdMsg"/></div>
<s:hidden name="role" value="admin"/>
<s:submit value="登录"/>
</s:form>
出现异常的原因:
jsp与struts.xml配置的默认命名空间不一样。
解决方法:
1.在struts中配置<package name="struts2" namespace="/" extends="struts-default">。相应的在jsp页面中配置 <s:form name="form1" action="Login" method="post" onsubmit="return checkLogin()" namespace="/">;
2.如果在struts.xml中指定命名空间的名字,如<package name="struts2" namespace="/hello" extends="struts-default">。那么在jsp页面中就应该配置<s:form name="form1" action="Login" method="post" onsubmit="return checkLogin()" namespace="/hello">;
- No configuration found for the specified action警告异常的解决方案
- 彻底解决警告: No configuration found for the specified action
- 警告: No configuration found for the specified action: 'PointAction'
- No configuration found for the specified action警告总结
- 警告: No configuration found for the specified action:
- 警告: No configuration found for the specified action:
- 出现No configuration found for the specified action: 'tokenAction' in namespace: ''. Form action 警告的原因
- No configuration found for the specified action异常
- No configuration found for the specified action:异常
- 警告: No configuration found for the specified action: 'checkLogin' in namespace: ''.的解决办法
- 警告: No configuration found for the specified action: 'checkLogin' in namespace: ''.的解决办法
- 警告: No configuration found for the specified action: 'upload' in namespace: ''.的解决办法
- 警告: No configuration found for the specified action: 'checkLogin' in namespace: ''.的解决办法
- 警告: No configuration found for the specified action: 'checkLogin' in namespace: ''.的解决办法
- No configuration found for the specified action
- No configuration found for the specified action:
- 警告: No configuration found for the specified action: '/myNameSpace/login.action' in names
- 警告: No configuration found for the specified action: '/myNameSpace/login.action' in names
- uva 11795(状态压缩dp)
- Android 快速开发框架AndroidAnnotations使用详解
- 3分钟get短信营销新视野
- 文章标题
- Cocos2d-Lua(Quick-Cocos2d-x)集成第三方SDK(二)
- No configuration found for the specified action警告异常的解决方案
- 【AndroidStudio】AndroidStudio如何连接手机
- Java Platform Standard Edition 8 技术框架
- QQ授权登录提示需要安装最新版本
- maven 编译java工程:<identifier> expected
- android判断app是否在运行RunningAppProcessInfo
- yispider 开源小说采集器 (来源http://git.oschina.net/yispider/yispider 我的修改版因为他的我无法跑)
- 理解threadLocal
- Android 微信支付集成