| Author |
Sturts Urgent query
|
Mukesh Kumar Yadav
Greenhorn
Joined: Sep 06, 2007
Posts: 2
|
|
I am using sturts and Hibernate and struts. I am new to struts and Hibernate framework.I am trying to populate the combobox.but don't get any success yet. I have a leftpannel filled with various links.I want, once I click one of these links,say productEntry link, a jsp pages get loaded which carries a combobox.This combobox get populated automatically from database. could anyone help me out by giving me a sample code.
|
 |
Vinod K Singh
Ranch Hand
Joined: Sep 30, 2008
Posts: 198
|
|
|
Do you know how to fetch data from database using Hibernate? If yes, then fetch the desired data and populate the combobox by iterating over it. logic:iterate tag of JSTL foreach tags will be helpful here.
|
My Blog
|
 |
Nishan Patel
Ranch Hand
Joined: Sep 07, 2008
Posts: 676
|
|
Hi.. In your Action class first make one list which retrieve your combo box value like private List<Country> countryList = getCountryList(); then jsp you can populate this country list using s:select like. <s:select theme="simple" name="country.countryName" list="countryList" listKey="countryName" listValue="countryId" value="%{country.countryId}" /> Thanks, Nishan Patel.
|
Thanks, Nishan Patel
SCJP 1.5, SCWCD 1.5, OCPJWSD Java Developer,My Blog
|
 |
 |
|
|
subject: Sturts Urgent query
|
|
|