File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

get datasource outside action class

 
roseline ruba
Greenhorn
Posts: 20
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,

Is there any option to get the datasource connection from the non-action class?, where the datasource specified in the struts-config.xml file.
 
Craig Bayley
Ranch Hand
Posts: 46
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
If the class shares the same InitialContext as the action class, then yes, no worries. You can just get the reference that way:

The <resource reference> corresponds to the context.xml entry (or server.xml entry)
<ResourceParams name="<resource reference">
 
With a little knowledge, a cast iron skillet is non-stick and lasts a lifetime.
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic