Win a copy of Functional Design and Architecture this week in the Functional programming 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 Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Ron McLeod
  • Rob Spoor
  • Tim Cooke
  • Junilu Lacar
Sheriffs:
  • Henry Wong
  • Liutauras Vilda
  • Jeanne Boyarsky
Saloon Keepers:
  • Jesse Silverman
  • Tim Holloway
  • Stephan van Hulst
  • Tim Moores
  • Carey Brown
Bartenders:
  • Al Hobbs
  • Mikalai Zaikin
  • Piet Souris

Problem using struts bean tag in tiles put tag

 
Ranch Hand
Posts: 35
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
    Number of slices to send:
    Optional 'thank-you' note:
  • 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 ]
 
You showed up just in time for the waffles! And this tiny ad:
Building a Better World in your Backyard by Paul Wheaton and Shawn Klassen-Koop
https://coderanch.com/wiki/718759/books/Building-World-Backyard-Paul-Wheaton
reply
    Bookmark Topic Watch Topic
  • New Topic