struts.xml: <struts> <constant name="struts.i18n.encoding" value="gbk" /> <constant name="struts.devMode" value="true" /> <package name="user" namespace="/user" extends="struts-default"> <action name="user" class="com.sd.action.TestAction"> <result> /rec.jsp </result> </action> </package> </struts> ----------------------------------------- index.jsp: <form action="user/user!rec" method="post"><input type="submit" value="提交"/> </form> -------------------------- Action: public class TestAction extends ActionSupport { private User user; public User getUser() { return user; } public void setUser(User user) { this.user = user; } public String rec() { if(user != null) { System.out.println("username=" + user.getUsername()); System.out.println("password=" + user.getPassword()); } else { System.out.println(user); } return SUCCESS; } -----------------------------------