日期:2014-05-18 浏览次数:20737 次
public String isLogin() {
HttpServletRequest request = null;
User u = new User();
u.setName(name);
u.setPwd(pwd);
u = loginService.isLogin(u);
if(u!=null) {
System.out.println("name"+name);
request.getSession().setAttribute("user", u);
return "ok";
}
return ERROR;
}
<action name="login_isLogin" class="com.wr.action.LoginAction" >
<result name="ok">success.jsp</result>
<result name="error">error.jsp</result>
</action>
<form action="login_isLogin.action" method="post">
name:<input type="text" name="name"/><br>
pwd:<input type="password" name="pwd"/>
<input type="submit" value="登录"/><input type="reset" value="重置"/>
</form>