You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@struts.apache.org by "Chen, Gin" <Gi...@tvratings.com> on 2002/10/21 16:39:28 UTC

Struts and Tiles and bean:message

Hi all,
	I have an application that defines a specific value in my resource
properties file as:

order.status.title=Order Status

	Since I am using tiles in my application. My main layout file cannot
use:

<bean:message key="order.status.title"/>

	because it is being used for other pages as well.

	Therefore, for ever subdefinition I define a value page.title:

<put name="page.title" value="login.title"/>

	How can I retrieve this to be used for the bean:message? Is there
another solution?

Thanks,
-Tim

--
To unsubscribe, e-mail:   <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>


Re: Struts and Tiles and bean:message

Posted by Cedric Dumoulin <ce...@apache.org>.
This question has already been asked. It should be in the struts 
archives ;-)
Here is a solution:

    * Specify the resource key in your <put ...>. This will create a
      tile's attribute.
    * Retrieve the tiles attribute value, and use it. 
          o Tiles attribute are stored in the tile context. You can
            import them in any jsp context with <tiles:importAttribute
            name="page.title" />
          o Use the value as any other bean: <bean:message
            name="page.title" />


  Cedric

Chen, Gin wrote:

>Hi all,
>	I have an application that defines a specific value in my resource
>properties file as:
>
>order.status.title=Order Status
>
>	Since I am using tiles in my application. My main layout file cannot
>use:
>
><bean:message key="order.status.title"/>
>
>	because it is being used for other pages as well.
>
>	Therefore, for ever subdefinition I define a value page.title:
>
><put name="page.title" value="login.title"/>
>
>	How can I retrieve this to be used for the bean:message? Is there
>another solution?
>
>Thanks,
>-Tim
>
>--
>To unsubscribe, e-mail:   <ma...@jakarta.apache.org>
>For additional commands, e-mail: <ma...@jakarta.apache.org>
>
>
>  
>


--
To unsubscribe, e-mail:   <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>