You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@struts.apache.org by "Richard D. LeCour" <rl...@zoho.com> on 2001/03/03 01:53:58 UTC

Nested tags don't work. What alternatives are there?

Here's some examples of what I'd like to do:

<template:put name='some.name' content='<bean:message key="some.message"/>'
direct='true'/>
    or
<html:img src='<bean:message key="image.url"/>' width='<bean:message
key="image.width"/>' height='<bean:message key="image.height"/>'/>
    or even
<% someVar = '<bean:message key="image.url"/>'; %>

But Struts doesn't seem to allow that. Can anyone suggest simple
alternatives? I am REALLY stuck. Thanks!

BTW, though I'm a Struts newbie, I've read most of the archives here and on
other Struts sites. I am already a convert and am spreading the word on this
terrific framework...


Re: Nested tags don't work. What alternatives are there?

Posted by Incze Lajos <in...@mail.matav.hu>.
On Fri, Mar 02, 2001 at 04:53:58PM -0800, Richard D. LeCour wrote:
> Here's some examples of what I'd like to do:
> 
> <template:put name='some.name' content='<bean:message key="some.message"/>'
> direct='true'/>

Especially this case is resolvable:

<template:put name="some.name">
  <bean:message key="some.message" />
</template:put>

>     or
> <html:img src='<bean:message key="image.url"/>' width='<bean:message
> key="image.width"/>' height='<bean:message key="image.height"/>'/>
>     or even
> <% someVar = '<bean:message key="image.url"/>'; %>
> 
> But Struts doesn't seem to allow that. Can anyone suggest simple
> alternatives? I am REALLY stuck. Thanks!
> 

I would not use bean:message for these cases. It's main purpose to hold
internationalized messages  and I hardly believe it would be the appropriate
structure for sitemap-like data. For these things you should use xml
files or databse. Then initialize some beans from these datastores and
you can use at least the standrad jsp scripting to access the properties.
                                                                 incze