Win a copy of Think Java: How to Think Like a Computer Scientist this week in the Java in General forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

PageLoad event

 
Java On
Greenhorn
Posts: 2
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
hi All,

i want to populate the drop down list from the database when page loads.
How to achieve the same in Struts2.0?
is there is any way to call certain action when page loads.

Thnx & Regards,
Abhi
 
David Newton
Author
Rancher
Posts: 12617
IntelliJ IDE Ruby
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
The Preparable interface may help.

http://struts.apache.org/2.x/docs/prepare-interceptor.html

Dave
 
Java On
Greenhorn
Posts: 2
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
hi,


interceptor are called on some action. But if the page is getting loaded from the browser first time, how to populate the drop down from database table as there is no action involved.
is there any solution apart from java scripting.

Thnx & Regrads,
Abhi
 
David Newton
Author
Rancher
Posts: 12617
IntelliJ IDE Ruby
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
In general you shouldn't go to a JSP page directly--all pages should be reached through an action.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic