You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@struts.apache.org by Caroline Jen <ji...@yahoo.com> on 2004/03/25 05:57:19 UTC

Tile Problem

In general, the tile works fine for me except the
"title" piece.
  
[CODE]
.....
<BODY>
<tiles:getAsString name="title"/>
<tiles:get name="header"/>
<tiles:get name="message"/>
<tiles:get name="content"/>
<tiles:get name="navbar"/>
</BODY>
.....
[/CODE]

In my tiles-def.xml, I have:

[CODE]
   <definition name=".article.Menu"
extends=".article.Base">
      <put name="title"    
value="article.Menu.title"/>
      <put name="content"  
value="/article/content/menu.jsp"/>
      <put name="navbar"   
value="/article/common/navbarMenu.jsp"/>
   </definition>
[/CODE]

The problem is that my application displays 

article.Menu.title

in the browser, instead of going to the
application.properties (which is in the
ApplicationRoot/WEB-INF/classes/resources folder) to
get 

article.Menu.title=Registered Members

What should I do?

__________________________________
Do you Yahoo!?
Yahoo! Finance Tax Center - File online. File on time.
http://taxes.yahoo.com/filing.html

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


Re: Tile Problem

Posted by Jason Lea <ja...@kumachan.net.nz>.
Are you using the struts-el tags.  You might have them installed as 
bean-el in which case you would need to use

<c:set var="titleKey"><tiles:getAsString 
name="title"/></c:set><bean-el:message
key="${titleKey}"/>

I only use the EL tags, so I just use bean as the tag prefix eg <%@ 
taglib uri="/WEB-INF/jsp/tags/struts-bean-el.tld" prefix="bean" %>



Caroline Jen wrote:

>I tried both of your suggestions.  For example, I have
>
>[code]
>.....
><BODY>
><c:set var="titleKey"><tiles:getAsString 
>name="title"/></c:set><bean:message
>key="${titleKey}"/>
><tiles:get name="header"/>
><tiles:get name="message"/>
><tiles:get name="content"/>
><tiles:get name="navbar"/>
></BODY>
>.....
>[/code]
>
>I got java.lang.IllegalArgumentException: can't parse
>argument number titleKey
>
>--- Jason Lea <ja...@kumachan.net.nz> wrote:
>  
>
>>If you are using JSTL you can do this:
>>
>><tile:useAttribute id="titleKey"
>>name="title"><bean:message 
>>key="${titleKey}"/>
>>
>>if that doesn't work, try this:
>>
>><c:set var="titleKey"><tiles:getAsString 
>>name="title"/></c:set><bean:message
>>key="${titleKey}"/>
>>
>>
>>
>>Caroline Jen wrote:
>>
>>    
>>
>>>In general, the tile works fine for me except the
>>>"title" piece.
>>> 
>>>[CODE]
>>>.....
>>><BODY>
>>><tiles:getAsString name="title"/>
>>><tiles:get name="header"/>
>>><tiles:get name="message"/>
>>><tiles:get name="content"/>
>>><tiles:get name="navbar"/>
>>></BODY>
>>>.....
>>>[/CODE]
>>>
>>>In my tiles-def.xml, I have:
>>>
>>>[CODE]
>>>  <definition name=".article.Menu"
>>>extends=".article.Base">
>>>     <put name="title"    
>>>value="article.Menu.title"/>
>>>     <put name="content"  
>>>value="/article/content/menu.jsp"/>
>>>     <put name="navbar"   
>>>value="/article/common/navbarMenu.jsp"/>
>>>  </definition>
>>>[/CODE]
>>>
>>>The problem is that my application displays 
>>>
>>>article.Menu.title
>>>
>>>in the browser, instead of going to the
>>>application.properties (which is in the
>>>ApplicationRoot/WEB-INF/classes/resources folder)
>>>      
>>>
>>to
>>    
>>
>>>get 
>>>
>>>article.Menu.title=Registered Members
>>>
>>>What should I do?
>>>
>>>__________________________________
>>>Do you Yahoo!?
>>>Yahoo! Finance Tax Center - File online. File on
>>>      
>>>
>>time.
>>    
>>
>>>http://taxes.yahoo.com/filing.html
>>>
>>>      
>>>
>>---------------------------------------------------------------------
>>    
>>
>>>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
>>
>>    
>>
>
>
>__________________________________
>Do you Yahoo!?
>Yahoo! Finance Tax Center - File online. File on time.
>http://taxes.yahoo.com/filing.html
>
>---------------------------------------------------------------------
>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: Tile Problem

Posted by Caroline Jen <ji...@yahoo.com>.
I tried both of your suggestions.  For example, I have

[code]
.....
<BODY>
<c:set var="titleKey"><tiles:getAsString 
name="title"/></c:set><bean:message
key="${titleKey}"/>
<tiles:get name="header"/>
<tiles:get name="message"/>
<tiles:get name="content"/>
<tiles:get name="navbar"/>
</BODY>
.....
[/code]

I got java.lang.IllegalArgumentException: can't parse
argument number titleKey

--- Jason Lea <ja...@kumachan.net.nz> wrote:
> If you are using JSTL you can do this:
> 
> <tile:useAttribute id="titleKey"
> name="title"><bean:message 
> key="${titleKey}"/>
> 
> if that doesn't work, try this:
> 
> <c:set var="titleKey"><tiles:getAsString 
> name="title"/></c:set><bean:message
> key="${titleKey}"/>
> 
> 
> 
> Caroline Jen wrote:
> 
> >In general, the tile works fine for me except the
> >"title" piece.
> >  
> >[CODE]
> >.....
> ><BODY>
> ><tiles:getAsString name="title"/>
> ><tiles:get name="header"/>
> ><tiles:get name="message"/>
> ><tiles:get name="content"/>
> ><tiles:get name="navbar"/>
> ></BODY>
> >.....
> >[/CODE]
> >
> >In my tiles-def.xml, I have:
> >
> >[CODE]
> >   <definition name=".article.Menu"
> >extends=".article.Base">
> >      <put name="title"    
> >value="article.Menu.title"/>
> >      <put name="content"  
> >value="/article/content/menu.jsp"/>
> >      <put name="navbar"   
> >value="/article/common/navbarMenu.jsp"/>
> >   </definition>
> >[/CODE]
> >
> >The problem is that my application displays 
> >
> >article.Menu.title
> >
> >in the browser, instead of going to the
> >application.properties (which is in the
> >ApplicationRoot/WEB-INF/classes/resources folder)
> to
> >get 
> >
> >article.Menu.title=Registered Members
> >
> >What should I do?
> >
> >__________________________________
> >Do you Yahoo!?
> >Yahoo! Finance Tax Center - File online. File on
> time.
> >http://taxes.yahoo.com/filing.html
> >
>
>---------------------------------------------------------------------
> >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
> 


__________________________________
Do you Yahoo!?
Yahoo! Finance Tax Center - File online. File on time.
http://taxes.yahoo.com/filing.html

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


Re: Tile Problem

Posted by Jason Lea <ja...@kumachan.net.nz>.
If you are using JSTL you can do this:

<tile:useAttribute id="titleKey" name="title"><bean:message 
key="${titleKey}"/>

if that doesn't work, try this:

<c:set var="titleKey"><tiles:getAsString 
name="title"/></c:set><bean:message key="${titleKey}"/>



Caroline Jen wrote:

>In general, the tile works fine for me except the
>"title" piece.
>  
>[CODE]
>.....
><BODY>
><tiles:getAsString name="title"/>
><tiles:get name="header"/>
><tiles:get name="message"/>
><tiles:get name="content"/>
><tiles:get name="navbar"/>
></BODY>
>.....
>[/CODE]
>
>In my tiles-def.xml, I have:
>
>[CODE]
>   <definition name=".article.Menu"
>extends=".article.Base">
>      <put name="title"    
>value="article.Menu.title"/>
>      <put name="content"  
>value="/article/content/menu.jsp"/>
>      <put name="navbar"   
>value="/article/common/navbarMenu.jsp"/>
>   </definition>
>[/CODE]
>
>The problem is that my application displays 
>
>article.Menu.title
>
>in the browser, instead of going to the
>application.properties (which is in the
>ApplicationRoot/WEB-INF/classes/resources folder) to
>get 
>
>article.Menu.title=Registered Members
>
>What should I do?
>
>__________________________________
>Do you Yahoo!?
>Yahoo! Finance Tax Center - File online. File on time.
>http://taxes.yahoo.com/filing.html
>
>---------------------------------------------------------------------
>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