struts2 action传值到jsp

action类

ActionContext ac = ActionContext.getContext();
   ac.getSession().put("username", username);

 

jsp

${username}

<%String username = (String)ActionContext.getContext().getSession().get("username");%>

你可能感兴趣的:(struts2)