81,094
社区成员
发帖
与我相关
我的任务
分享
String msg;
public String getMsg() {
return msg;
}
public void setMsg(String msg) {
this.msg = msg;
}
Action(value="testlogin",results={Result(name="success",location="/showInfo.jsp"),Result(name="error",params={"root","msg"},location="/LoginUI.jsp")})
public String login1(){
HttpSession session=ServletActionContext.getRequest().getSession();
if(vcode.equals(session.getAttribute("rand"))){
list=ls.userLogin(username, password);
if(list.size()>0){
return "success";
}else{
msg="用户名或密码错误!";
return "error";
}
}else{
msg="验证码错误";
return "error";
}
}
<body>
<div id="tab">
<h1 style="color: white;font-weight: bold;font-style: italic; ">天津市96中学教务巡查系统</h1>
<div class="tab_box" style="border-style:outset;border-radius:5px">
<div>
<div class="stu_error_box"></div>
<form action="testlogin" method="post" >
<div id="username">
<label>账 号</label> <input type="text"
id="username" name="username" placeholder="请输入账号..." />
</div>
<div id="password">
<label>密 码</label> <input type="password"
id="password" name="password" placeholder="请输入密码..."/>
</div>
<div id="code">
<label>验证码</label> <input type="text" id="vcode"
name="vcode"placeholder="请输入验证码 " />
<img alt="" src="vcode.jsp" width="90px" height="30px" align="middle"/>
</div><br />
<div id="login">
<button type="submit" style="background-color: green">登陆</button><br />
</div>
</form>
</div>
</div>
</div>
</body>