| Author |
How to create a drop down on pageload with data from a db
|
Joe Matt
Greenhorn
Joined: Feb 11, 2009
Posts: 4
|
|
Hello,
I am running a web application on tomcat 6.0 using jsp and mvc controllers.I have a jsp page which has a drop down list. This is the first/home page of the application. The drop down should be populated with data from a database when the page is first loaded. I was hoping to get the data as an object in the controller and use the jstl tags in the jsp page to create the drop down list
I am using mvc but no frameworks like spring or struts. Is there any methods similar to the refrencedata method in spring to prepopulate the form with data from backend? I am confused as how to trigger the controller to load the data from the db since there are no actions performed on the page when the page gets loaded first.
Thanks
-Joe
|
 |
Bear Bibeault
Author and ninkuma
Marshal
Joined: Jan 10, 2002
Posts: 56150
|
|
I'm not understanding the issue. If the page needs the data, the page controller fetches it from the model. Why does there need to be "page activity"?
Or, are you not using a page controller for your "home" page? If not, why not?
|
[Smart Questions] [JSP FAQ] [Books by Bear] [Bear's FrontMan] [About Bear]
|
 |
Joe Matt
Greenhorn
Joined: Feb 11, 2009
Posts: 4
|
|
thank you. I wasn't passing the jsp through the controller and that was the problem.
-Joe
|
 |
 |
|
|
subject: How to create a drop down on pageload with data from a db
|
|
|