This week's giveaway is in the Groovy forum.
We're giving away four copies of Groovy Fundamentals video training course and have Ken Kousen on-line!
See this thread for details.
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 Groovy Fundamentals video training course this week in the Groovy 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??

jQuery in Action, 2nd edition
subject: Probem of html:select