标签:
计应143 赵先亮
登录
</head>
<body>
<form action="login.action" method="post">
用户名<input type="text" name="userID"><br>
密码<input type="text" name="password"><br>
<input type="submit" value="登录">
</form>
</body>
</html>
判断
<?xml version="1.0" encoding="UTF-8" ?>
<!-- 用户登录 -->
<action name="login" class="asd.js">
<result name="success">/MyJsp.jsp</result>
<result name="error">/fou.jsp</result>
</action>
</package>
<constant name="struts.i18n.encoding" value="gb2312"></constant>
</struts>
package asd;
import com.opensymphony.xwork2.ActionSupport;
@SuppressWarnings("serial")
public class js extends ActionSupport {
private String userID;
private String password;
public String getUserID() {
return userID;
}
public void setUserID(String userID) {
this.userID = userID;
}
public String getPassword() {
return password;
}
public void setPassword(String password) {
this.password = password;
}
@Override
public String execute() throws Exception {
// TODO Auto-generated method stub
if(userID.equals("aaa")&&password.equals("123"))
return "success";
else{ return "error";}
}
}
标签:
原文地址:http://www.cnblogs.com/zxlizsm/p/5314933.html