Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

<bean:write> formatkey attribute

Status
Not open for further replies.

sourabhjha

Programmer
Jan 13, 2002
121
0
0
IN
Hi,
Any idea how to solve this?

I am using <bean:write> within logic iterate to display a particular attribute of a bean. I want that instead of displaying attribute name, it should display a diferent namespecified in properties file. How is that possible?
Structure of my code:

<logic:iterate id="someBean" name="iterate" scope="page" >
<bean:write name="someBean" property="MyNeeds" />
</logic:iterate>
right now it displays for eg: INSRD,NTINSRN,etc
I want it should display: Insured, Not Insured,etc.
 
I think you are going to have to do pre processing on the strings and replace what you need to do the conversion. Unless you already have these other items loaded into other java variables then you can use a <logic:equal> <bean:write othervar> </logic:equal>. I don't believe struts can be used exactly the way you want, unless the other file is set up as a resource, key:value pairs, then you could use the MessagesResources class.

Hope that gets you thinking,
~Ron

typedef map<GiantX,gold, less<std::shortestpathtogold> > AwesomeMap;
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top