You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@struts.apache.org by Mike Bell <be...@dsg-inc.com> on 2001/03/01 16:37:29 UTC

Passing a bean property to template:put tag

Hello,
Is there a way to pass a bean property to a template:put content?
I've tried using a <bean:write...> in the content parameter but it just
passes it straight through (with or without direct set).
I've also tried:

<bean:define id="xyz" name="theForm" property="theProperty"/>
<template:insert template='/corePageHeader.jsp'>
  <template:put name="title" content='xyz' />
</template:insert>

Still just passes the 'xyz' literal.

I've also tried Oleg's ExtPut like:

<template:insert template='/pageHeader.jsp'>
  <template:extput name="title">
    <bean:write name="theForm" property="theproperty"/>
  </template:extput>
</template:insert>

But that doesn't work either.  Any ideas?

-Mike

Re: Passing a bean property to template:put tag

Posted by Incze Lajos <in...@mail.matav.hu>.
On Thu, Mar 01, 2001 at 10:37:29AM -0500, Mike Bell wrote:
> Hello,
> Is there a way to pass a bean property to a template:put content?
> I've tried using a <bean:write...> in the content parameter but it just
> passes it straight through (with or without direct set).
> I've also tried:
> 
> <bean:define id="xyz" name="theForm" property="theProperty"/>
> <template:insert template='/corePageHeader.jsp'>
>   <template:put name="title" content='xyz' />
> </template:insert>
>
The current template implementation let's you non-empty template:put
(like exput and it should work:

<bean:define id="xyz" name="theForm" property="theProperty"/>
<template:insert template='/corePageHeader.jsp'>
  <template:put name="title">
    <bean:write name="xyz" />
  </template:put>
</template:insert>
                                                     incze