Win a copy of Re-engineering Legacy Software this week in the Refactoring forum
or Docker in Action in the Cloud/Virtualization forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

is Action getDataSource method removed from Struts 1.2.9

 
Hongjun Zhang
Greenhorn
Posts: 3
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Does anybody know whether Action.getDataSource is removed from Struts 1.2.9?
Checked the API doc on apache web site and couldn't see this method anymore. But 1.2.9 struts.jar file seems still support this method. Does anyone know what's going on? Thanks.
 
Merrill Higginson
Ranch Hand
Posts: 4864
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
For a long time the authors of Struts have indicated that the datasource functions included with Struts are a "last resort" in case your Application server doesn't support data sources very well. Since now any application server that's worth anything at all has good support for data sources, the authors of Struts have deprecated the Struts data source API.

The best practice is (and for a long time has been) to define datasources using whatever method your App Server recommends, and then to access them in your code with a JNDI lookup.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic