You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@struts.apache.org by Raj Atchutuni <ra...@yahoo.com> on 2003/09/23 01:25:12 UTC
Re: Page Title
How do i assign different title for each page using tiles. Following is my tile layout which has title "My Site Name". And it has Header, Side Menu, BODY, Footer.
Should i have <title></title> in each BODY jsp ?
Is there any short cut to get the page name and over ride the main layout title ?
Thanks for the help.
Raj
----------------------------------------------------------------------------------------
<title>My Site Name</title>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
</head>
<body bgcolor="#FFFFFF" text="#000000" leftmargin="0" topmargin="0" marginwidth="0" marginheight="0">
<table width="770" border="0" cellspacing="0" cellpadding="0" align="center">
<tr>
<td width="770">
<tiles:insert attribute="header" />
</td>
</tr>
<tr>
<td>
<table width="770" border="0" cellspacing="0" cellpadding="0">
<tr>
<td width="144" valign="top"><tiles:insert attribute="menu" /></td>
<td width="626" valign="top"><tiles:insert attribute="body" /></td>
</tr>
</table>
</td>
</tr>
<tr>
<td width="770">
<tiles:insert attribute="footer" />
</td>
</tr>
</table>
</body>
</html>
---------------------------------
Do you Yahoo!?
Yahoo! SiteBuilder - Free, easy-to-use web site design software
Re: Page Title
Posted by khote <kh...@mminternet.com>.
<definition extends="default.layout" name="browse.costcenters"
controllerclass="org.apache.struts.tiles.ActionController"
>
<put name="title" value="BIS-Web Browse Cost Centers"/>
<put name="body-content" value="/custom/browse-costcenters.jsp"/>
</definition>
Look up ActionController in the
http://jakarta.apache.org/struts/api/index.html
(
http://jakarta.apache.org/struts/api/org/apache/struts/tiles/ActionController.html )
in particular
you can extend that class, put your localized title in the ComponentContext
context argument.
----- Original Message -----
From: "Craig R. McClanahan" <cr...@apache.org>
To: "Struts Users Mailing List" <st...@jakarta.apache.org>
Sent: Monday, September 22, 2003 6:45 PM
Subject: Re: Page Title
> Bryce Fischer wrote:
>
> >>How do i assign different title for each page using tiles. Following is
my tile layout which has title "My Site Name". And it has Header, Side Menu,
BODY, Footer.
> >>Should i have <title></title> in each BODY jsp ?
> >>
> >>Is there any short cut to get the page name and over ride the main
layout title ?
> >>
> >>
> >
> >Definitely.
> >
> >Put this in your header:
> >
> ><title><tiles:getAsString name="title"/></title>
> >
> >Now, in your tiles-def.xml file, put this:
> >
> > <definition extends="default.layout" name="browse.costcenters">
> > <put name="title" value="BIS-Web Browse Cost Centers"/>
> > <put name="body-content" value="/custom/browse-costcenters.jsp"/>
> > </definition>
> >
> >
> >
> I'm almost embarrassed to ask this :-), but is there a way to localize
> the replacement title?
>
> Craig McClanahan
>
>
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: struts-user-unsubscribe@jakarta.apache.org
> For additional commands, e-mail: struts-user-help@jakarta.apache.org
>
---------------------------------------------------------------------
To unsubscribe, e-mail: struts-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: struts-user-help@jakarta.apache.org
Re: Page Title
Posted by Jason Lea <ja...@kumachan.net.nz>.
Craig R. McClanahan wrote:
> Bryce Fischer wrote:
>
>>> How do i assign different title for each page using tiles. Following
>>> is my tile layout which has title "My Site Name". And it has Header,
>>> Side Menu, BODY, Footer.
>>> Should i have <title></title> in each BODY jsp ?
>>>
>>> Is there any short cut to get the page name and over ride the main
>>> layout title ?
>>>
>>
>>
>> Definitely.
>>
>> Put this in your header:
>>
>> <title><tiles:getAsString name="title"/></title>
>>
>> Now, in your tiles-def.xml file, put this:
>>
>> <definition extends="default.layout" name="browse.costcenters">
>> <put name="title" value="BIS-Web Browse Cost Centers"/>
>> <put name="body-content" value="/custom/browse-costcenters.jsp"/>
>> </definition>
>>
>>
>>
> I'm almost embarrassed to ask this :-), but is there a way to localize
> the replacement title?
Not directly that I know of.
However, I put the resource key for the page in the tiles definition eg
<put name="title" value="page.xyz.key" type="String"/>
Then you can use this to write out the localised page title in the JSP page:
<tiles:importAttribute name="title"/>
<bean:message name="title"/>
>
> Craig McClanahan
>
>
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: struts-user-unsubscribe@jakarta.apache.org
> For additional commands, e-mail: struts-user-help@jakarta.apache.org
>
>
--
Jason Lea
---------------------------------------------------------------------
To unsubscribe, e-mail: struts-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: struts-user-help@jakarta.apache.org
Re: Page Title
Posted by Varun Garg <va...@yahoo.com>.
I did this.
<definition extends="default.layout"
name="browse.costcenters">
<put name="title" value="broswe.customers"/>
<put name="body-content"
value="/custom/browse-costcenters.jsp"/>
</definition>
<tiles:useAttribute name="title" id="titlee"
classname="java.lang.String"/>
<bean:message name="<%=titlee%>"/>
--- "Craig R. McClanahan" <cr...@apache.org> wrote:
> Bryce Fischer wrote:
>
> >>How do i assign different title for each page
> using tiles. Following is my tile layout which has
> title "My Site Name". And it has Header, Side Menu,
> BODY, Footer.
> >>Should i have <title></title> in each BODY jsp ?
> >>
> >>Is there any short cut to get the page name and
> over ride the main layout title ?
> >>
> >>
> >
> >Definitely.
> >
> >Put this in your header:
> >
> ><title><tiles:getAsString name="title"/></title>
> >
> >Now, in your tiles-def.xml file, put this:
> >
> > <definition extends="default.layout"
> name="browse.costcenters">
> > <put name="title" value="BIS-Web Browse
> Cost Centers"/>
> > <put name="body-content"
> value="/custom/browse-costcenters.jsp"/>
> > </definition>
> >
> >
> >
> I'm almost embarrassed to ask this :-), but is there
> a way to localize
> the replacement title?
>
> Craig McClanahan
>
>
>
>
>
---------------------------------------------------------------------
> To unsubscribe, e-mail:
> struts-user-unsubscribe@jakarta.apache.org
> For additional commands, e-mail:
> struts-user-help@jakarta.apache.org
>
---------------------------------------------------------------------
To unsubscribe, e-mail: struts-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: struts-user-help@jakarta.apache.org
Re: Page Title
Posted by "Craig R. McClanahan" <cr...@apache.org>.
Bryce Fischer wrote:
>>How do i assign different title for each page using tiles. Following is my tile layout which has title "My Site Name". And it has Header, Side Menu, BODY, Footer.
>>Should i have <title></title> in each BODY jsp ?
>>
>>Is there any short cut to get the page name and over ride the main layout title ?
>>
>>
>
>Definitely.
>
>Put this in your header:
>
><title><tiles:getAsString name="title"/></title>
>
>Now, in your tiles-def.xml file, put this:
>
> <definition extends="default.layout" name="browse.costcenters">
> <put name="title" value="BIS-Web Browse Cost Centers"/>
> <put name="body-content" value="/custom/browse-costcenters.jsp"/>
> </definition>
>
>
>
I'm almost embarrassed to ask this :-), but is there a way to localize
the replacement title?
Craig McClanahan
---------------------------------------------------------------------
To unsubscribe, e-mail: struts-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: struts-user-help@jakarta.apache.org
Re: Page Title
Posted by Bryce Fischer <br...@berzerker-soft.com>.
> How do i assign different title for each page using tiles. Following is my tile layout which has title "My Site Name". And it has Header, Side Menu, BODY, Footer.
> Should i have <title></title> in each BODY jsp ?
>
> Is there any short cut to get the page name and over ride the main layout title ?
Definitely.
Put this in your header:
<title><tiles:getAsString name="title"/></title>
Now, in your tiles-def.xml file, put this:
<definition extends="default.layout" name="browse.costcenters">
<put name="title" value="BIS-Web Browse Cost Centers"/>
<put name="body-content" value="/custom/browse-costcenters.jsp"/>
</definition>
--
Bryce Fischer <br...@berzerker-soft.com>
---------------------------------------------------------------------
To unsubscribe, e-mail: struts-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: struts-user-help@jakarta.apache.org