[mw_shl_code=java,true] avalik String fun1() { ActionContext actionContext = ActionContext.getContext(); actionContext.getApplication().put("app", "app scope"); actionContext.getSession().put("sec", "secssion scope"); actionContext.put("req", "request scope"); actionContext.put("nimed", Arrays.asList("Zhang San", "Li Si", "Wang Wu")); tagastada "sõnum";
}
public String getServlet() { HttpServletRequest request = ServletActionContext.getRequest(); request.setAttribute("req", "request scope"); request.getSession().setAttribute("sec", "Secssion Scope"); ServletContext servletContext = ServletActionContext.getServletContext(); servletContext.setAttribute("app", "app scope"); tagastada "sõnum"; [/mw_shl_code] |