You are viewing an old version of this page. View the current version.

Compare with Current View Page History

« Previous Version 16 Next »

The application, session and request objects are available from within s 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'\]"/>

<s: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.

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

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

Exposing framework objects to JSTL, with a JSTL and DisplayTag Example

  • No labels