Win a copy of Five Lines of Code this week in the OO, Patterns, UML and Refactoring forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Bear Bibeault
  • Ron McLeod
  • Jeanne Boyarsky
  • Paul Clapham
Sheriffs:
  • Tim Cooke
  • Liutauras Vilda
  • Junilu Lacar
Saloon Keepers:
  • Tim Moores
  • Stephan van Hulst
  • Tim Holloway
  • fred rosenberger
  • salvin francis
Bartenders:
  • Piet Souris
  • Frits Walraven
  • Carey Brown

Problem using struts bean tag in tiles put tag

 
Ranch Hand
Posts: 35
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi

I have a question : I have a tiles base jsp page and wanted to have one of the "put" item in it to get its value by using the struts bean tag with the message attribute. Something like this -

<tiles:insert page="/layout/BasicLayout.jsp" flush="true">
. . .
<tiles : put name="title" value="<bean:message key="FAQ.title.display"/>" type="String" />
. . .
</tiles:insert>

and the BasicLayout.jsp is getting the "title" as -

<head>
<html:base />
<title><tiles:getAsString name="title" /></title>

I am using MyEclipse IDE with BEA Weblogic plugged in, Struts 1.1.
All the config is done properly and the files ar located correctly.
If I do a 'view source' on the browser (IE 6.0.x) I can see the first line as - <tiles : put name="title" value="Frequently Asked Questions" type="String" />, so it can get the value but the page is getting errors and redirected to custom Error Page. If I remove the bean tag and hard code it to a value, it works fine.
Anybody, any idea why this is happening or whether it is possible at all to do this ?! I just wanted to reduce hard coding in my code and let the resources.properties be the only location that needs changes if at all needed !

thanks in advance and have a gr8 weekend !

--Shailesh Welankar

[ July 01, 2005: Message edited by: Shailesh Welankar ]

[ July 01, 2005: Message edited by: Shailesh Welankar ]
[ July 01, 2005: Message edited by: Shailesh Welankar ]
 
Ranch Hand
Posts: 190
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I didn't know one can do the way you did.

What I normally do is ask the resource manager to get the message for the key and then do the value="<%=myMessageValue%>" thingy.

Originally posted by Shailesh Welankar:
Hi

<tiles : put name="title" value="<bean:message key="FAQ.title.display"/>" type="String" />


[ July 03, 2005: Message edited by: Ken Loh ]
 
Consider Paul's rocket mass heater.
    Bookmark Topic Watch Topic
  • New Topic