81,092
社区成员
发帖
与我相关
我的任务
分享
public String login() {
System.out.println("----->+进来了么?");
userVo.setMess(null);
// request对象
HttpServletRequest request = ServletActionContext.getRequest();
try {
User user = ub.login(userVo.getUser());
if (user != null) {
request.getSession().setAttribute(Const.USER, user);
return Action.SUCCESS;
} else {
userVo.setMess("登陆失败!");
return Action.INPUT;
}
} catch (Exception e) {
// TODO Auto-generated catch block
e.printStackTrace();
return Action.ERROR;
}
<action name="login" class="com.shop.action.UserAction" method="login">
<!-- 不拦截的调用-->
<interceptor-ref name="paramsPrepareParamsStack"/>
<!-- dispatcher:转发||redirect:重定向 -->
<result name="success" type="redirect">/selbyid.html?pageIndex=1&sel=up</result>
<result name="input">/login.jsp</result>
</action>
<s:form action="login" theme="simple" method="post" onsubmit="return loginf();">