• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
  • Campbell Ritchie
  • Ron McLeod
  • Rob Spoor
  • Tim Cooke
  • Junilu Lacar
  • Henry Wong
  • Liutauras Vilda
  • Jeanne Boyarsky
Saloon Keepers:
  • Jesse Silverman
  • Tim Holloway
  • Stephan van Hulst
  • Tim Moores
  • Carey Brown
  • Al Hobbs
  • Mikalai Zaikin
  • Piet Souris

onLoad in DispatchAction

Ranch Hand
Posts: 39
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Dear All,

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,
Ranch Hand
Posts: 4864
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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 ]
You showed up just in time for the waffles! And this tiny ad:
Building a Better World in your Backyard by Paul Wheaton and Shawn Klassen-Koop
    Bookmark Topic Watch Topic
  • New Topic