This week's book giveaway is in the OCAJP 8 forum. We're giving away four copies of OCA Java SE 8 Programmer I Study Guide and have Edward Finegan & Robert Liguori on-line! See this thread for details.
I have two drop down lists. Based on the value selected in the first drop down, the values in the second should pop up. And these values have to come from database. Can anyone help me how to do this plz.
Hi Latha I'm no expert on this, but I'd think you would need to pass your request with the selection made in the first drop-down to a servlet, the servlet would in turn retrieve the appropriate data from the database based on that value, and then pass control to the JSP page to render this retrieved data in the 2nd drop-down. The retrieved database data could be stored by the servlet in a Java Bean, and used as such (ie. jsp:useBean) in the JSP. Or the servlet could store the retrieved data as an Enumeration object of the database values, and the JSP could iterate through the Enumeration object to build the 2nd drop-down list. Presumably the Bean or Attribute objects would be in session scope as they are specific to a particular user. Hope this helps
where arrList would be an arrayList Iterate the arrList and populte the second combo box.. Implement the database access logic in the bean. Hope this helps Cheers Geeta