JavaScud | Forum | JIRA | Blog |
  Dashboard > WebWork2文档中文化计划 > ... > Cookbook > Application, Session, Request objects in jsp
  WebWork2文档中文化计划 Log In View a printable version of the current page.  
  Application, Session, Request objects in jsp
Added by scud, last edited by scud on Mar 30, 2006  (view change)
Labels: 
(None)

The application, session and request objects are available from within ww tags in jsp wherever ognl can be evaluated. Use the #session syntax to get the object and access values by their keys using ['key'].

<ww:property value="#application\['foo'\]"/>

<ww:property value="#session\['baz'\]"/>

Conversely, if you would like to make webwork objects availible to say the jsp/jstl request scope. The property tag can be used like this.

<ww:set name="jobz" value="jobs" scope="request" />

A full example below shows a webwork variable "jobs" being exposed as "jobz" and being used with jstl and the display tag.

[WW:Exposing webwork objects to JSTL, with a JSTL and DisplayTag Example]

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