日期:2014-05-19 浏览次数:20693 次
private String name; private User user; public String getName() { return name; } public void setName(String name) { this.name = name; } public User getUser() { return user; } public void setUser(User task) { this.user = user; } ...... public String getUser() throws Exception { user=userService.findByName(name); return "show"; } ......
<s:if test="user!=null"> <s:property value="user.name" /> </s:if>
private String name; private User user; public String getName() { return name; } public void setName(String name) { this.name = name; } public User getUser() { return user; } public void setUser(User task) { this.user = user; } public String UserAdd() throws Exception { User user=new User(); user.setName=name; userService.save(user); return("add") {
...... <form method="post" action="add" id="add"> <s:textfield name="name"/> <button type="submit">保 存</button> </form> .....
<bean id="a" class="cn.x.x.x.xAction" scope="prototype">