s标签显示后台数据的基本用法以及iterator遍历用法(1)
- UID
- 1066743
|
s标签显示后台数据的基本用法以及iterator遍历用法(1)
普通属性
java文件赋值并且set和get
private String username;
private String password;
public String getUsername() {
return username;
}
public void setUsername(String username) {
this.username = username;
}
public String getPassword() {
return password;
}
public void setPassword(String password) {
this.password = password;
}
public String execute(){
username = "zhangsan";
password = "123";
}
jsp页面中
<s:property value="username"/><br>
<s:property value="password"/><br>
自定义对象
java文件中赋值并且set和get userInfo
public String execute(){
userInfo = new UserInfo();
userInfo.setUsername("hhh");
userInfo.setPassword("111");
}
jsp页面中
<s:property value="userInfo.username"/><br>
<s:property value="userInfo.password"/><br> |
|
|
|
|
|