Struts2传值问题
简单写下了:------常量publicConstant{publicstaticfinalStringLFLAG="flag";publicstaitcfinalint...
简单写下了:
------常量
public Constant{
public static final String LFLAG="flag";
public staitc final int VALUE=1;
}
-------Action
public doAction(){
public String doIt(){
HttpServletRequest request = ServletActionContext.getRequest();
request.setAttribute(Constant.LFLAG,Constant.VALUE);
result "successs";
}
-------Jsp页面
<s:if test="验证request过来的常量值是否为1,这段代码怎么写?">
</s:if>
如果在action中写了session/request.setAttribute(),在jsp页面怎么用ognl标签获得传过来的值 展开
------常量
public Constant{
public static final String LFLAG="flag";
public staitc final int VALUE=1;
}
-------Action
public doAction(){
public String doIt(){
HttpServletRequest request = ServletActionContext.getRequest();
request.setAttribute(Constant.LFLAG,Constant.VALUE);
result "successs";
}
-------Jsp页面
<s:if test="验证request过来的常量值是否为1,这段代码怎么写?">
</s:if>
如果在action中写了session/request.setAttribute(),在jsp页面怎么用ognl标签获得传过来的值 展开
2个回答
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询