• 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 all forums
this forum made possible by our volunteer staff, including ...
  • Campbell Ritchie
  • Bear Bibeault
  • Paul Clapham
  • Jeanne Boyarsky
  • Knute Snortum
  • Liutauras Vilda
  • Tim Cooke
  • Junilu Lacar
Saloon Keepers:
  • Ron McLeod
  • Stephan van Hulst
  • Tim Moores
  • Tim Holloway
  • Carey Brown
  • Joe Ess
  • salvin francis
  • fred rosenberger

onLoad in DispatchAction

Ranch Hand
Posts: 39
  • Mark post as helpful
  • send pies
  • 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
  • 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 ]
I found some pretty shells, some sea glass and this lovely tiny ad:
Sauce Labs - World's Largest Continuous Testing Cloud for Websites and Mobile Apps
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!