Win a copy of Re-engineering Legacy Software this week in the Refactoring forum
or Docker in Action in the Cloud/Virtualization forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Problem using struts bean tag in tiles put tag

 
Shailesh Welankar
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 ]
 
Ken Loh
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 ]
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic