警告: No configuration found for the specified action: 'login.action' in namespace: '/'.

警告: No configuration found for the specified action: 'login.action' in namespace: '/'. Form action defaulting to 'action' attribute's literal value.


struts.xml文件配置如下:

 

   <package name="default" namespace="/" extends="struts-default">
        <action name="login" class="com.rjkf.userlogin.action.LoginAction">
            <result name="success">/success.jsp
            </result>
            <result name="error">/error.jsp
            </result>
        </action>
    </package>

jsp页面如下:

	<h1>用户登陆</h1>
	<s:form name="Login" action="login.action" method="post" namespace="/">
		<s:textfield name="username" label="用户名"></s:textfield><br>
		<s:password name="password" label="密码"></s:password><br>
		<s:submit name="submit" value="登陆"></s:submit>
	</s:form>
在网上找了很多资料没有解决,原来是

struts2的标签<s:form 会自动添加.action 我们不用手动添加

所以我们将

<s:form name="Login" action="login.action" method="post" namespace="/">
改为
<s:form name="Login" action="login" method="post" namespace="/">
就OK了

如果不是用struts标签则需手动添加.action

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值