struts2访问或添加request等属性

1、public string scope()throws Exception

{

   ActionContext ctx = ActionContext.getContext();

   ctx.getApplication().put("app","应用范围");//往ServietContext里放入app

   ctx.getSession().put("ses","session范围");//往Session里放入ses

   ctx.put("req","request范围");//往request里放入req

   return"sxope";

}

JSP:

<body>

${applicationScope.app}<br>

${aessionScope.ses}<br>

${requestScope.req}<br>

</body>

你可能感兴趣的:(request等属性)