It's not a secret anymore!*
The moose likes Struts and the fly likes Probem of html:select 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 "Probem of html:select" Watch "Probem of html:select" New topic

Probem of html:select

Irshad Malek

Joined: Aug 04, 2005
Posts: 25

I have one select box in my jsp per record,
there are some values are coming from database in that select box,
what i m doing i m just taking that values from database and setting it into object and that object i m setting into the list,

this is my code of jsp

<html:select property="name">
<html ptions collection="list" property="name" labelProperty="name" />

list i set into request from my action class

this list contains many names,
and i have one name per record and i want that to be selected that perticular name,

how i do,

Thank You

Vijendra Runwal
Ranch Hand

Joined: Apr 17, 2006
Posts: 52
i think for that you need to have different names for options property and select property.
The option property will help you set the selected value.
But in your case both the names are same.
try different names then try.
hope that might work out??

With a little knowledge, a cast iron skillet is non-stick and lasts a lifetime.
subject: Probem of html:select
Similar Threads
selecting a value in drop down box
Struts 1.1: Help needed with html:select, html:options, html:optionsCollection
Problem with multiple select object
Problem passing parameter with optionsCollection
Retrieving different values in seperate dropdown fbox