1. ActionContext 在Struts2开发中,除了将请求参数自动设置到Action的字段中,我们往往也需要在Action里直接获取请求(Request)或会话 (Session)的一些信息,甚至需要直接对JavaServlet Http的请求(HttpServletReque...
分类:
其他好文 时间:
2014-07-29 16:12:59
阅读次数:
205
@Override public String execute() throws Exception { if ("none".equals(task)) { HttpServletResponse response = ServletActionContext.getResponse();...
分类:
其他好文 时间:
2014-07-26 00:01:56
阅读次数:
389
package com.bgsnewlook.action; import com.opensymphony.xwork2.ActionSupport; import org.apache.struts2.ServletActionContext; import java.io.InputStream; import java.net.URLEncoder; public class Dow...
分类:
其他好文 时间:
2014-07-21 10:18:38
阅读次数:
252
1、ServletActionContext.getServletContext().getRealPath("/")得到:C:\Users\JL\Workspaces\.metadata\.me_tcat\webapps\HuiLife\ServletActionContext.getServle...
分类:
移动开发 时间:
2014-07-21 09:35:13
阅读次数:
267
设置时效:1分钟HttpSession session=ServletActionContext.getRequest().getSession(true); session.setAttribute("random", random); session.setMaxIn...
分类:
其他好文 时间:
2014-07-16 18:40:37
阅读次数:
167
ApplicationContext ac1 = WebApplicationContextUtils.getRequiredWebApplicationContext(ServletActionContext.getServletContext()); TopicAction result = ....
分类:
编程语言 时间:
2014-06-20 18:48:36
阅读次数:
220
1、项目根目录(tomcat、web项目)String path = ServletActionContext.getServletContext().getRealPath("");System.out.println(path);想要获取图片存放的位置,则为String path = Servl...
分类:
其他好文 时间:
2014-06-15 16:27:14
阅读次数:
205
ActionContext 获取
域引用的mapServletActionContext获取具体域对象//域范围 ActionContext ac =
ActionContext.getContext(); Map applicationMap = ac.getAppli...
分类:
其他好文 时间:
2014-06-06 17:23:42
阅读次数:
183
1、HttpServletRequest
request=ServletActionContext.getRequest(); ........request.setAttribute("list",
list);2#request.list ...
分类:
Web程序 时间:
2014-05-19 12:34:32
阅读次数:
282
创建session:
ServletActionContext.getRequest().getSession().setAttribute("update", model);
DutiesScienceEndowScore update = (DutiesScienceEndowScore) .....
分类:
编程语言 时间:
2014-05-17 23:06:39
阅读次数:
244