解放军职务等级:Struts2?页面数据处理

来源:百度文库 编辑:九乡新闻网 时间:2024/05/06 07:34:46
取页面的attribute: 在jsp页面中getServletContext().setAttribute("tt","hehe");action中:Map map = ActionContext.getContext().getApplication();         map.get("tt"); 1、输出session中的值
a.     ,
b. ${sessionScope.key}

2、获取session中的值后判断


3、输出Action中的属性值


4、输出国际化文件中的值
a.
b. ${getText("key")}

5、输出Action中的消息


6、输出Action中的错误


7、迭代输出集合

























8、定义页面变量







${pageScope.count }


<%
Object obj = pageContext.getAttribute("count");
int mycount = Integer.parseInt(obj.toString());
for(int i =0;iout.print(i+1);
}
%>