JavaScud | Forum | JIRA | Blog |
  Dashboard > WebWork2文档中文化计划 > ... > FAQ > How can I get the HttpServletRequest
  WebWork2文档中文化计划 Log In View a printable version of the current page.  
  How can I get the HttpServletRequest
Added by scud, last edited by scud on May 19, 2006  (view change)
Labels: 
(None)

Method A:
ServletActionContext.getRequest() (works internally using a ThreadLocal)

Method B:
Have the action implements ServletRequestAware and the servlet request will be set through setServletRequest(HttpServletRequest) method. This requires the action to have a 'servlet-config' interceptor added.

@see webwork-default.xml
@see com.opensymphony.webwork.interceptor.ServletRequestAware
@see com.opensymphony.webwork.interceptor.ServletConfigInterceptor

Site running on a free Atlassian Confluence Open Source Project License granted to WebWork China. Evaluate Confluence today.
Powered by Atlassian Confluence, the Enterprise Wiki. (Version: 2.5.3 Build:#808 May 29, 2007) - Bug/feature request - Contact Administrators