You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@struts.apache.org by Gonçalo Luiz <go...@gmail.com> on 2007/02/03 17:06:48 UTC

Use tiles:getAsString to return a key to s:text

Hello,

I'd like to do something like <s:get name="<tiles:getAsString
name="title"/>"/> to internationalize my page title. Then in the tiles
configuration I'd have

<put name="title" value="some.key"/>

Is this possible to achive ?

When I try the above code all I get is an error: "/layout.jsp(7,17)
equal symbol expected"


Can you help me ?
-- 
Gonçalo Luiz

---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
For additional commands, e-mail: user-help@struts.apache.org


Re: Use tiles:getAsString to return a key to s:text

Posted by Oren Livne <ol...@aoce.utah.edu>.
Hi Luiz,
I am only a novice but this might help: replace the quotes by a single 
quote around the title:
<s:get name="<tiles:getAsString name='title'/>"/>
Oren

Gonçalo Luiz wrote:
> Hello,
>
> I'd like to do something like <s:get name="<tiles:getAsString
> name="title"/>"/> to internationalize my page title. Then in the tiles
> configuration I'd have
>
> <put name="title" value="some.key"/>
>
> Is this possible to achive ?


---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
For additional commands, e-mail: user-help@struts.apache.org


Re: Use tiles:getAsString to return a key to s:text

Posted by Gonçalo Luiz <go...@gmail.com>.
Hello Dave,

Thank you for your reply.

I'd like to have a "default" title in my layout tile and then redefine
it in the tiles I want, just like I redefine the other tiles
components.

The problem I'm having is that I'm not getting a tag to work when it
have another tag as an attribute value.

I think its not these particular tags problem. What if I have the X
tag that has the x attribute
and the Y that with the y attribute. Is it possible to have <X x="<Y
y="someValue"/>"/> ?

Best Regards,
Gonçalo Luiz

On 03/02/07, Dave Newton <ne...@yahoo.com> wrote:
> --- Gonçalo Luiz <go...@gmail.com> wrote:
> > Is it clear what I'm trying to achieve ?
>
> No; Why do you want the key in the tiles file?
>
> d.
>
>
>
>
> ____________________________________________________________________________________
> Food fight? Enjoy some healthy debate
> in the Yahoo! Answers Food & Drink Q&A.
> http://answers.yahoo.com/dir/?link=list&sid=396545367
>


-- 
Gonçalo Luiz

---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
For additional commands, e-mail: user-help@struts.apache.org


Re: Use tiles:getAsString to return a key to s:text

Posted by Gonçalo Luiz <go...@gmail.com>.
Hello,

Thank you very much, it indeed worked.

Regards,
Gonçalo Luiz.

On 04/02/07, Djordje Trifunovic <dj...@cisco.com> wrote:
> Hi Gonçalo,
>
> Nesting tag as an attribute of another tag is not supported. To accomplish
> this particular task of passing key through tiles, try this instead:
>
>   <tiles:importAttribute name="title" />
>   <s:text name="%{#attr['title']}"/>
>
> Regards,
> Dj.
>
> -----Original Message-----
> From: Gonçalo Luiz [mailto:goncalo.luiz@gmail.com]
> Sent: Saturday, February 03, 2007 7:53 PM
> To: Dave Newton
> Cc: Struts Users Mailing List
> Subject: Re: Use tiles:getAsString to return a key to s:text
>
> Hello Dave,
>
> Thank you for your answer.
>
> However what I want to achieve is a little more than just
> internationalization, what I can do by simply using <s:text
> name="some.key"/>.
>
> What I'm seeking is to put a key in tiles configuration file (usually
> tiles.xml) like:
>
> <put name="title" value="some.key"/>
>
> that gets included in the page by using <tiles:getAsString
> name="title"/>. However by doing just this I get literally "some.key"
> on my pages title. So what I'm tring is to do use that string in a
> <s:text> tag like
>
> <s:text name="<tiles:getAsString name="title">"/> however I'm getting
> one of two problems:
>
> 1 - If i use the above statement I get a "expecting equal symbol" exception
> 2 - if I use Oren's suggestion I get <tiles:getAsString anme="title"/>
> literally in my page's title.
>
> Is it clear whatI'm trying to achieve ?
>
> Best Regards,
> Gonçalo Luiz.
>
> On 03/02/07, Dave Newton <ne...@yahoo.com> wrote:
> > --- Gonçalo Luiz <go...@gmail.com> wrote:
> > > I'd like to do something like <s:get
> > > name="<tiles:getAsString
> > > name="title"/>"/> to internationalize my page title.
> >
> > You want to put the key in your tiles file?
> >
> > S2 properties are already I18N-aware:
> >
> > http://cwiki.apache.org/WW/localization.html
> >
> > d.
> >
> >
> >
> >
> >
> ____________________________________________________________________________
> ________
> > Any questions? Get answers on any topic at www.Answers.yahoo.com.  Try it
> now.
> >
>
>
> --
> Gonçalo Luiz
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
> For additional commands, e-mail: user-help@struts.apache.org
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
> For additional commands, e-mail: user-help@struts.apache.org
>
>


-- 
Gonçalo Luiz

---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
For additional commands, e-mail: user-help@struts.apache.org


Re: Use tiles:getAsString to return a key to s:text

Posted by Dave Newton <ne...@yahoo.com>.
--- Gonçalo Luiz <go...@gmail.com> wrote:
> Is it clear what I'm trying to achieve ?

No; Why do you want the key in the tiles file?

d.



 
____________________________________________________________________________________
Food fight? Enjoy some healthy debate 
in the Yahoo! Answers Food & Drink Q&A.
http://answers.yahoo.com/dir/?link=list&sid=396545367

---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
For additional commands, e-mail: user-help@struts.apache.org


RE: Use tiles:getAsString to return a key to s:text

Posted by Djordje Trifunovic <dj...@cisco.com>.
Hi Gonçalo,

Nesting tag as an attribute of another tag is not supported. To accomplish
this particular task of passing key through tiles, try this instead:

  <tiles:importAttribute name="title" />
  <s:text name="%{#attr['title']}"/>

Regards,
Dj.

-----Original Message-----
From: Gonçalo Luiz [mailto:goncalo.luiz@gmail.com] 
Sent: Saturday, February 03, 2007 7:53 PM
To: Dave Newton
Cc: Struts Users Mailing List
Subject: Re: Use tiles:getAsString to return a key to s:text

Hello Dave,

Thank you for your answer.

However what I want to achieve is a little more than just
internationalization, what I can do by simply using <s:text
name="some.key"/>.

What I'm seeking is to put a key in tiles configuration file (usually
tiles.xml) like:

<put name="title" value="some.key"/>

that gets included in the page by using <tiles:getAsString
name="title"/>. However by doing just this I get literally "some.key"
on my pages title. So what I'm tring is to do use that string in a
<s:text> tag like

<s:text name="<tiles:getAsString name="title">"/> however I'm getting
one of two problems:

1 - If i use the above statement I get a "expecting equal symbol" exception
2 - if I use Oren's suggestion I get <tiles:getAsString anme="title"/>
literally in my page's title.

Is it clear whatI'm trying to achieve ?

Best Regards,
Gonçalo Luiz.

On 03/02/07, Dave Newton <ne...@yahoo.com> wrote:
> --- Gonçalo Luiz <go...@gmail.com> wrote:
> > I'd like to do something like <s:get
> > name="<tiles:getAsString
> > name="title"/>"/> to internationalize my page title.
>
> You want to put the key in your tiles file?
>
> S2 properties are already I18N-aware:
>
> http://cwiki.apache.org/WW/localization.html
>
> d.
>
>
>
>
>
____________________________________________________________________________
________
> Any questions? Get answers on any topic at www.Answers.yahoo.com.  Try it
now.
>


-- 
Gonçalo Luiz

---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
For additional commands, e-mail: user-help@struts.apache.org

---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
For additional commands, e-mail: user-help@struts.apache.org


Re: Use tiles:getAsString to return a key to s:text

Posted by Gonçalo Luiz <go...@gmail.com>.
Hello Dave,

Thank you for your answer.

However what I want to achieve is a little more than just
internationalization, what I can do by simply using <s:text
name="some.key"/>.

What I'm seeking is to put a key in tiles configuration file (usually
tiles.xml) like:

<put name="title" value="some.key"/>

that gets included in the page by using <tiles:getAsString
name="title"/>. However by doing just this I get literally "some.key"
on my pages title. So what I'm tring is to do use that string in a
<s:text> tag like

<s:text name="<tiles:getAsString name="title">"/> however I'm getting
one of two problems:

1 - If i use the above statement I get a "expecting equal symbol" exception
2 - if I use Oren's suggestion I get <tiles:getAsString anme="title"/>
literally in my page's title.

Is it clear whatI'm trying to achieve ?

Best Regards,
Gonçalo Luiz.

On 03/02/07, Dave Newton <ne...@yahoo.com> wrote:
> --- Gonçalo Luiz <go...@gmail.com> wrote:
> > I'd like to do something like <s:get
> > name="<tiles:getAsString
> > name="title"/>"/> to internationalize my page title.
>
> You want to put the key in your tiles file?
>
> S2 properties are already I18N-aware:
>
> http://cwiki.apache.org/WW/localization.html
>
> d.
>
>
>
>
> ____________________________________________________________________________________
> Any questions? Get answers on any topic at www.Answers.yahoo.com.  Try it now.
>


-- 
Gonçalo Luiz

---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
For additional commands, e-mail: user-help@struts.apache.org


Re: Use tiles:getAsString to return a key to s:text

Posted by Dave Newton <ne...@yahoo.com>.
--- Gonçalo Luiz <go...@gmail.com> wrote:
> I'd like to do something like <s:get
> name="<tiles:getAsString
> name="title"/>"/> to internationalize my page title.

You want to put the key in your tiles file?

S2 properties are already I18N-aware:

http://cwiki.apache.org/WW/localization.html

d.



 
____________________________________________________________________________________
Any questions? Get answers on any topic at www.Answers.yahoo.com.  Try it now.

---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
For additional commands, e-mail: user-help@struts.apache.org