File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
The moose likes Spring and the fly likes Spring dependency injection in a Struts Plugin Big Moose Saloon
  Search | Java FAQ | Recent Topics
Register / Login
JavaRanch » Java Forums » Application Frameworks » Spring
Reply Bookmark "Spring dependency injection in a Struts Plugin" Watch "Spring dependency injection in a Struts Plugin" New topic
Author

Spring dependency injection in a Struts Plugin

Ashish Bassi
Greenhorn

Joined: Aug 22, 2007
Posts: 11
I have a Struts/Spring application.

I'm writing a new Struts plugin like


Now i need to initialize my service in this plugin using Spring DI, but im unable to find a way to achieve this. Please help
Ganesh Gowtham
Ranch Hand

Joined: Mar 30, 2005
Posts: 221

HI ,

Best way to use spring + struts is to followany of these types ( ContextLoaderPlugIn, ActionSupport , DelegatingRequestProcessor,DelegatingActionProxy )

Check this LInk


Loading the application context

No matter which technique you use, you will need to use the Spring ContextLoaderPlugin to load the Spring application context for the Struts ActionServlet. Simply add the plug-in to your struts-config.xml file as you would any other plug-in, as shown here:



Thanks, Ganesh Gowtham
http://ganesh.gowtham.googlepages.com
 
 
subject: Spring dependency injection in a Struts Plugin
 
Threads others viewed
Answer
Struts Plugin - Getting webapplicationcontext or service factory in struts plug-in class
Introducing Spring in Struts2 Project
a plugin for struts
getWebApplicationContext() w/ Struts
IntelliJ Java IDE

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