This week's book giveaway is in the Mac OS forum.
We're giving away four copies of a choice of "Take Control of Upgrading to Yosemite" or "Take Control of Automating Your Mac" and have Joe Kissell 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
Author

Pre-populating a drop down list using STRUTS

Damendra Chahal
Greenhorn

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
Marshal

Joined: Jan 10, 2002
Posts: 61315
    
  66

Moving to the Frameworks forum.


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

Joined: May 26, 2003
Posts: 30596
    
154

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


[Blog] [JavaRanch FAQ] [How To Ask Questions The Smart Way] [Book Promos]
Blogging on Certs: SCEA Part 1, Part 2 & 3, Core Spring 3, OCAJP, OCPJP beta, 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.


Nathaniel Stodard<br />SCJP, SCJD, SCWCD, SCBCD, SCDJWS, ICAD, ICSD, ICED
 
GeeCON Prague 2014
 
subject: Pre-populating a drop down list using STRUTS