警告: No configuration found for the specified action: 'loginPerson' in namespace: ''. Form action def
来源:互联网 发布:电工理论与新技术 知乎 编辑:程序博客网 时间:2024/04/30 03:22
用struts2写一个登陆小程序,结果tamcat抛了这样的异常:
警告: No configuration found for the specified action: 'loginPerson' in namespace: ''. Form action defaulting to 'action' attribute's literal value.
2012-8-21 13:41:48 com.opensymphony.xwork2.util.logging.jdk.JdkLogger warn
警告: No configuration found for the specified action: 'loginPerson' in namespace: ''. Form action defaulting to 'action' attribute's literal value.
这个问题折腾了半天,有的人还说struts.xml要加ation名称后面要加.action 我整理了两种解决上述警告的方法:
第一种:采用系统的默认名空间
struts.xml配置:
<package name="main" extends="struts-default" >
<global-results>
<result name="login">/login.jsp</result>
</global-results>
<action name="loginPerson" class="com.helloweenvsfei.struts2.action.LoginAction" >
<result name="success">/success.jsp</result>
</action>
</package>
</struts>
jsp页面的主要配置:
<body>
<struts:form action="loginPerson" method="post" >
<struts:label value="登陆系统"></struts:label>
<struts:textfield name="account" label="账号"></struts:textfield>
<struts:password name="password" label="密码"></struts:password>
<struts:submit value="登陆"></struts:submit>
</struts:form>
</body>
此时jsp页面的此action的路径会被解析为/myApp/loginPerson.action
第二种: 采用自定义命名空间
struts.xml配置:
<package name="main" extends="struts-default" namespace="/hello">
<global-results>
<result name="login">/login.jsp</result>
</global-results>
<action name="loginPerson" class="com.helloweenvsfei.struts2.action.LoginAction" >
<result name="success">/success.jsp</result>
</action>
</package>
jsp页面的配置:
<body>
<struts:form action="loginPerson" method="post" namespace="/hello">
<struts:label value="登陆系统"></struts:label>
<struts:textfield name="account" label="账号"></struts:textfield>
<struts:password name="password" label="密码"></struts:password>
<struts:submit value="登陆"></struts:submit>
</struts:form>
</body>
此时jsp页面的action路径会被解析为/myApp/hello/loginPerson
另外不管是哪种配置的struts.xml中的action的名称会被struts自动追加.action后缀,所以不管是那种配置方法都不应该将action的名称配置为***.action
- 警告: No configuration found for the specified action: 'loginPerson' in namespace: ''. Form action def
- No configuration found for the specified action: 'xxx/xxx.action' in namespace: ''. Form action def
- 警告: No configuration found for the specified action: 'hello/sum' in namespace: '/hello'. Form action
- 警告: No configuration found for the specified action: 'register' in namespace: '/jsp'. Form action de
- 警告: No configuration found for the specified action: 'upload' in namespace: ''. Form action . . .
- 出现No configuration found for the specified action: 'tokenAction' in namespace: ''. Form action 警告的原因
- 警告: No configuration found for the specified action: '/sdoubleselect.jsp' in namespace: ''. Form act
- 警告: No configuration found for the specified action: '/myNameSpace/login.action' in namespace: ''. F
- 警告: No configuration found for the specified action: 'login.action' in namespace: '/'.
- 警告: No configuration found for the specified action: 'login.action' in namespace: '/'.
- No configuration found for the specified action: '/login.action' in namespace: '/myNameSpace'. Form
- No configuration found for the specified action: '/myNameSpace/login.action' in namespace: ''. Form
- No configuration found for the specified action: '/sum' in namespace: ''.Form action defaulting to '
- No configuration found for the specified action: '' in namespace: ''. Form action defaulting to 'act
- No configuration found for the specified action: ''in namespace: '/'
- No configuration found for the specified action: '/' in namespace
- No configuration found for the specified action: 'user' in namespace: ''
- 警告: No configuration found for the specified action: 'ShowMessage' in namespace:
- 修改liunx的预读区大小
- Nginx warn] the "log_format"
- 排序算法总结(c#版)
- 【windows8开发】现有代码移植到Metro App所必须的API整合
- win下实现切换帐号的方法
- 警告: No configuration found for the specified action: 'loginPerson' in namespace: ''. Form action def
- 关于List和IList的区别和不同情况的不同用法
- 做一个像植物大战僵尸的Flash游戏5
- USACO Factorials,DP,因子分解
- 数据库连接,查询和插入数据的方法
- eclispe中debug调试程序
- andorid移植好文
- 多行数据提交到Struts的ActionForm的List属性中
- C# 中的委托和事件