Win a copy of Clojure in Action this week in the Clojure forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Spring web flow and servlet context

 
Himanshu Babuni
Greenhorn
Posts: 4
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
 
I agree. Here's the link: http://aspose.com/file-tools
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic