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 Pre-populating a drop down list using STRUTS Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login

JavaRanch » Java Forums » Frameworks » Struts
Bookmark "Pre-populating a drop down list using STRUTS" Watch "Pre-populating a drop down list using STRUTS" New topic

Pre-populating a drop down list using STRUTS

Damendra Chahal

Joined: Jun 23, 2004
Posts: 1
How do i pre-popualte a drop-down list and display the selected value when fixing errors that occur through my STRUTS application.

I am using the <html ption> construction tag which uses a bean from session to dynamically populate the drop-down.

The page also uses a Form Bean to capture the values added in the text boxes.

Any solutions would be greatful.
Bear Bibeault
Author and ninkuma

Joined: Jan 10, 2002
Posts: 63208

Moving to the Frameworks forum.

[Asking smart questions] [Bear's FrontMan] [About Bear] [Books by Bear]
Jeanne Boyarsky
author & internet detective

Joined: May 26, 2003
Posts: 32481

Are you using the <html:select> tag within your <html:form> ? If so, you get this functionality for free.

[OCA 8 book] [Blog] [JavaRanch FAQ] [How To Ask Questions The Smart Way] [Book Promos]
Other Certs: SCEA Part 1, Part 2 & 3, Core Spring 3, TOGAF part 1 and part 2
Nathaniel Stoddard
Ranch Hand

Joined: May 29, 2003
Posts: 1258
Jeanne's correct. Struts will make one of the choices selected based on the value of your form bean property.

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: Pre-populating a drop down list using STRUTS
It's not a secret anymore!