SSH框架将信息存到session中并在页面上显示
1、Action中:
1 HttpServletRequest request=(HttpServletRequest) ServletActionContext.getRequest(); 2 HttpSession session=request.getSession(); 3 session.setAttribute("Admin", admin);
2、jsp页面获取:
用struts标签: <s:property value="#session.Admin.adminName" />
用EL表达式:${session.Admin.adminName}
用java代码:<%=session.getAttribute("Admin.adminName")%>