This week's book giveaway is in the OO, Patterns, UML and Refactoring forum.
We're giving away four copies of Refactoring for Software Design Smells: Managing Technical Debt and have Girish Suryanarayana, Ganesh Samarthyam & Tushar Sharma on-line!
See this thread for details.
The moose likes Struts and the fly likes LabelValueBean in struts Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login

JavaRanch » Java Forums » Frameworks » Struts
Bookmark "LabelValueBean in struts" Watch "LabelValueBean in struts" New topic

LabelValueBean in struts

Bobby Sands

Joined: May 21, 2006
Posts: 3
Can any one please help me out.

I have a list of labelValueBean, i.e. Which is used to populate the values
in a drop down box.

I want to display this selected value in a printer Friendly page. I am getting only the 'key' from the labelvaluebean, how can I get the actual value using bean:write

Merrill Higginson
Ranch Hand

Joined: Feb 15, 2005
Posts: 4864
The LavelValue bean does not extend java.util.Map, so it has no lookup function. If you want to be able to lookup the value from the key, use HashMap, or Treemap if you want the map to be in order by key. Use the key for the value and the value for the label.

In your regular JSP, you can represent it like this:

Then in the printable version you can write:

<cut value="${ssapcontractType[id_typ_cntr]}" />
[ July 09, 2006: Message edited by: Merrill Higginson ]

Consultant, Sima Solutions
I’ve looked at a lot of different solutions, and in my humble opinion Aspose is the way to go. Here’s the link:
subject: LabelValueBean in struts
It's not a secret anymore!