| toc | |
| <mm:write>
The write tag can be used to `export' context variables to something else. When you only specify what variable (with the `referid' or `value' attribute), then this tag writes to the page (therefore it is named `write'), unless it has a body, in which case the information is simply available to other tags in the body (like another write tag without attributes). This is the behavior of `writer' tags, and this tag is the most basic version of that. Being a `writer' tag it also supports the `jspvar' attribute with which you can make a JSP variable available in the body. In addition to this basic `writer' functionality, the `write' tag itself can also write context variables to other storage locations, like the session and in cookies. |
|
| see also | import |
| attributes |
|
| writer attributes | |
| writerreferrer attributes | |
| contextwriter attributes | |
| contextreferrer attributes | |
| example 1 |
<!-- write the variable `hoi' to the page --> <mm:write referid="hoi" /> |
| example 2 |
<!-- Create a JSP-variable `greet' from context variable `hoi', write
`greet' uppercased to the page -->
<mm:write referid="hoi" jspvar="greet"><%= greet.toUpperCase() %></mm:write>
|
| example 3 |
<mm:write referid="a" session="abc" /> <mm:import id="b" externid="abc" from="session" /> <!-- would copy the value of `a' to `b'. --> |