<body>
<s:form action="user/tologin.action" method="post">
<s:textarea name="id"></s:textarea>
<s:password name="user.password"></s:password>
<s:textfield name="user.name"></s:textfield>
<s:submit value="提交" method="login"></s:submit>
<s:submit value="打印" method="print"></s:submit>
</s:form>
</body>
<action name="tologin" class="UserAction" >
<result>/WEB-INF/user/list.jsp</result>
</action>
public class UserAction extends ActionSupport{
private static final long serialVersionUID = 1L;
private User user;
private String id;
@Override
public String execute() throws Exception {
return ActionSupport.SUCCESS;
}
public String login(){
return ActionSupport.SUCCESS;
}
public String print(){
System.out.println(user.getName());
System.out.println(user.getPassword());
System.out.println(id);
return ActionSupport.SUCCESS;
}
public User getUser() {
return user;
}
public void setUser(User user) {
this.user = user;
}
public String getId() {
return id;
}
public void setId(String id) {
this.id = id;
}
}