----- Original Message -----
From: "Marcelo Vanzin" <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Thursday, August 23, 2001 8:04 AM
Subject: Re: "default action" and templates


> Erik Hatcher wrote:
>
> > Why not use the Action to populate request scoped variables that you
then
> > <bean:write> inside <template:put> tags?
>
>
> This was actually my other question from yesterday. I could not find a
> way to do that, not with bean:write at least.

This should work....


request.setAttribute("name","this is a test"); // in your Action

<!-- in your template-using JSP page -->
<template:put name="content"><bean:write name="name"/> </template:put>

<!-- in your template definition JSP page -->
<template:get name="content"/>

> > Or have a look at the source code to the <template:put> tag and
>
> > reverse-engineer it!  :)
>
> Hehehe, I tried that, really. :-) But it seems that the values used by
> template:get are stored in a stack in the "ContentMapStack" class, and
> the map key is the "PageContext". If only I could find a way to access
> the PageContext from inside the Action class...

But the template stuff gets put into request scope, so you don't need page
context specifically.

    Erik


Reply via email to