wood burning stoves 2.0*
The moose likes Struts and the fly likes PageLoad event Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


JavaRanch » Java Forums » Frameworks » Struts
Bookmark "PageLoad event" Watch "PageLoad event" New topic
Author

PageLoad event

Java On
Greenhorn

Joined: Dec 16, 2008
Posts: 2
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

Joined: Sep 29, 2008
Posts: 12617

The Preparable interface may help.

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

Dave
Java On
Greenhorn

Joined: Dec 16, 2008
Posts: 2
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

Joined: Sep 29, 2008
Posts: 12617

In general you shouldn't go to a JSP page directly--all pages should be reached through an action.
 
GeeCON Prague 2014
 
subject: PageLoad event