Struts错误

  敲了书上的小Demo,关于拦截器,在输入登陆信息后始终跳不到成功页面。

而MyEclipse也发出这样的警告信息:

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


二话不说,上代码 



    <font color="red" style="font-size: 12px">
     <s:property value="#session.errorMsg"/>
     <s:form action="login.action" method="post" >
     <s:textfield name="username" label="用户名" size="20"></s:textfield>
     <s:password name="pwd" label="密码" size="20"></s:password>
     <s:submit value="登录"></s:submit>
     </s:form>
    </font>




<package name = "default" extends = "struts-default" namespace = "/">
<interceptors>
<interceptor name="myitp" class="com.liu.actions.LoginInterceptor"></interceptor>
<interceptor name="contentItp" class="com.liu.actions.ContentInterceptor"></interceptor>
</interceptors>
<action name = "login" class = "com.liu.actions.UserAction">
<result name="success">/success.jsp</result>
<result name = "login">/login.jsp</result>
<interceptor-ref name="myitp"></interceptor-ref>
</action>
<action name="content" class="com.liu.actions.ContentAction">
<result>/content_success.jsp</result>
<result name="login">/content_send.jsp</result>
<interceptor-ref name="defaultStack"></interceptor-ref>
<interceptor-ref name="contentItp">
<param name="excludeMethods">login</param>
</interceptor-ref>
</action>
</package>


解决方法:试着在form表单加入<s:form action="login.action" method="post" namespace="/">

还是解决不了。我的心碎。

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值