简体   繁体   中英

How to populate drop down list in JSP from a database

I have been trying to get a simple solution for this situation for almost two months but have completely failed. I'm putting up my first 'real project' in JSP, that is, 'Car Search Finder' tool. Where a user selects from a populated drop down list of 'Car Make' then brings up 'Car Model Option', 'Body Type' then plus other options like 'Mileage' , 'Price', 'Year'. I'm really confused where to begin from but realized after several online searches that it is some how more easier to develop with JSP - Struts. I have gone through an introduction of Struts using Eclipse and realized it's not so much frightening. As a beginner I'm wondering what to do , actually the directions plus a bit brush up of code needed to write up the drop down populated in list in Struts (Action Class, XML. etc). I will be grateful for any advice.

Struts will have action classes which is redirected to the jsp page to display all the values on jsp page. Before redirecting the dropdown list collection variable should get assigned to the values from database to display on Jsp.

Refer this link

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM