IntelliJ Java IDE
The moose likes Other Application Frameworks and the fly likes Spring web flow and servlet context Big Moose Saloon
  Search | Java FAQ | Recent Topics
Register / Login
JavaRanch » Java Forums » Application Frameworks » Other Application Frameworks
Reply Bookmark "Spring web flow and servlet context" Watch "Spring web flow and servlet context" New topic
Author

Spring web flow and servlet context

Himanshu Babuni
Greenhorn

Joined: Jun 07, 2004
Posts: 4
Hi,
I am new to SWF.
I am able to inject the datasource through Spring DI(IOC) and its working fine. My doubt is how to get the servletContext inside my action class.

My requirement is I want to load some data from the Database(only once) when the server starts(Tomcat) and it should be placed globally so that all my action classes can access the same data.

Please look into the below code.

public class TestAction extends FormAction
{
private JdbcDataSource jdbcDataSource;

public TestAction (JdbcDataSource jdbcDataSource) {
this.jdbcDataSource = jdbcDataSource;
}

public Event getLinks(RequestContext req){
// How to get ServletContext from org.springframework.webflow.RequestContext object.
return success();
}
}

Really waiting for your replies.

Advance Thanx.
Babuni
 
 
subject: Spring web flow and servlet context
 
Threads others viewed
How to get data back on result page from struts
Struts framework question.. thanks..
parameter variable to action class instance variable
Swing Interapp Communication
Populating a list of Objects in Struts2
developer file tools

cast iron skillet 49er

more from paul wheaton's glorious empire of web junk: cast iron skillet diatomaceous earth rocket mass heater sepp holzer raised garden beds raising chickens lawn care CFL flea control missoula heat permaculture