webwork / docs / attributesinjsp.html

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
<html xmlns="http://www.w3.org/1999/xhtml" lang="en_US" xml:lang="en_US">
  <meta http-equiv="Content-Type" content="text/html; charset=UTF-8"/>
  <title>WebWork Documentation</title>
  <link type="text/css" href="main.css" rel="STYLESHEET"/>
  <div id="page-logo">
    <a href="index.html"><img src="logo-small.png" border="0"/></a>
    <div class="snip-title">
	  <h1 class="snip-name">Application, Session, Request objects in jsp
<div id="snip-content" class="snip-content">

 <div class="snip-attachments"></div>
 The appliation, 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 &#91;'key'].<div class="code"><pre>&#60;ww:property value=<span class="java&#45;quote">"#application&#91;'foo'&#93;"</span>/&#62;<p class="paragraph"/>&#60;ww:property value=<span class="java&#45;quote">"#session&#91;'baz'&#93;"</span>/&#62;</pre></div>
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.<p class="paragraph"/><div class="code"><pre>&#60;ww:set name=<span class="java&#45;quote">"jobz"</span> value=<span class="java&#45;quote">"jobs"</span> scope=<span class="java&#45;quote">"request"</span> /&#62;</pre></div><p class="paragraph"/>A full example below shows a webwork variable "jobs" being exposed as "jobz" and being used with jstl and the display tag.<p class="paragraph"/><a href="http://wiki.opensymphony.com/space/Example%2C+exposing+webwork+objects+to+JSTL%2C+with+a+JSTL+and+DisplayTag+Example">Example, exposing webwork objects to JSTL, with a JSTL and DisplayTag Example</a>

Tip: Filter by directory path e.g. /media app.js to search for public/media/app.js.
Tip: Use camelCasing e.g. ProjME to search for ProjectModifiedEvent.java.
Tip: Filter by extension type e.g. /repo .js to search for all .js files in the /repo directory.
Tip: Separate your search with spaces e.g. /ssh pom.xml to search for src/ssh/pom.xml.
Tip: Use ↑ and ↓ arrow keys to navigate and return to view the file.
Tip: You can also navigate files with Ctrl+j (next) and Ctrl+k (previous) and view the file with Ctrl+o.
Tip: You can also navigate files with Alt+j (next) and Alt+k (previous) and view the file with Alt+o.