Meaningless Drivel is fun!*
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


Win a copy of Android Security Essentials Live Lessons this week in the Android forum!
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: 60794
    
  65

Moving to the Frameworks forum.


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

Joined: May 26, 2003
Posts: 30136
    
150

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
 
It is sorta covered in the JavaRanch Style Guide.
 
subject: Pre-populating a drop down list using STRUTS
 
Similar Threads
Session values of a Backing Bean in JSF
dependent select boxes with ajax .
Dynamic drop down in struts
drop down like google auto suggest in strut 1.2
Drop down list value