I am having a jsp page menupage.jsp now in this page I am having three links 1. Category 2. Sub Category 3. Item for desplay of this linke i use <html:link> tag.
now when some one clicks on Category link the category.jsp page should be desplayed. At here my problamse starts. In this page I want to desplay all the existing categories in a drop down menu. I write the code for fatching the values of category from database. But i cant get any idea for showing all these categories in a drop down as the page is load. for solving this i try to use onLoad method in MyDispatchAction but it won't work. So anybody please guide me for populating the valuis in a drop down befor the page is submited I mean as user see the page first time it should be with all the category values.
Thanking you, Ishaan
posted 8 years ago
Just create a new action named something like PrepareMenu and put logic in this action to retrieve the categories and put them either in the ActionForm bean or in request scope and forward to the menupage JSP. Then, instead of using the URL /MyApp/menupage.jsp to display the page, use the URL /MyApp/PrepareMenu.do. [ August 28, 2007: Message edited by: Merrill Higginson ]