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

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

Method B:
Have the action implements ResponseAware and the response will be set through setServletResponse(HttpServletResponse). The action needs to have 'servlet-config' interceptor added to it.

@see webwork-default.xml
@see com.opensymphony.webwork.interceptor.ServletResponseAware
@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