%是用来提取属性是String类型的比如%{getText("name")};
$是在资源文件里用的多,比如年龄在10到100之间,可以写,年龄在${min}和${max} ,el表达式;
#号代表ActionContext.getContext(),request.getAttribute("name")就#request.name ,一般用于堆栈
--想传递到页面上,可以通过如下4种方式:---
<s:property value="username"/>
${username}
<s:property value="#request.username"/> (#session. #application.类似)
<s:property value="%{username}"/>
$是在资源文件里用的多,比如年龄在10到100之间,可以写,年龄在${min}和${max} ,el表达式;
#号代表ActionContext.getContext(),request.getAttribute("name")就#request.name ,一般用于堆栈
\\先定义一个action,有个username字段,假设value="luojc"。
public class Login extends ActionSupport {
private String username;
public String execute() throws Exception {
return INPUT;
}
public String getUsername() {
return username;
}
public void setUsername(String username) {
this.username = “luojc”;
}
}
--想传递到页面上,可以通过如下4种方式:---
<s:property value="username"/>
${username}
<s:property value="#request.username"/> (#session. #application.类似)
<s:property value="%{username}"/>