File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
The moose likes Struts and the fly likes Accessing data source inside Action servlet Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of OCA/OCP Java SE 7 Programmer I & II Study Guide this week in the OCPJP forum!
JavaRanch » Java Forums » Frameworks » Struts
Bookmark "Accessing data source inside Action servlet" Watch "Accessing data source inside Action servlet" New topic
Author

Accessing data source inside Action servlet

Tad Dicks
Ranch Hand

Joined: Nov 16, 2004
Posts: 264
Ok I've extended the ActionServlet for a web app so I could initialize values in the servletContext from the database. How can I access the datasources that are set up in the struts-config?
I've found a method which seems to be depracated (and didn't work): getDataSource(String name);
and then I found a member called dataSources which is a "fastHashMap"
And I'm not quite sure how to get the dataSource from it. I'm only using one data source so its not "keyed".


-Tad
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Accessing data source inside Action servlet