File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
The moose likes Other Application Frameworks and the fly likes Spring bean in strutsAction Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Android Security Essentials Live Lessons this week in the Android forum!
JavaRanch » Java Forums » Frameworks » Other Application Frameworks
Bookmark "Spring bean in strutsAction" Watch "Spring bean in strutsAction" New topic
Author

Spring bean in strutsAction

Rudradutt Joshi
Ranch Hand

Joined: Dec 06, 2008
Posts: 45

Hi,

Thank you for your time,
I want to use a spring bean in struts action, that is all ready being initialized when the container starts. I had tried to get it with static applicationcontext, but it also initializes spring applicationContext second time. I also don't think its an efficient way.


Regards,
Rudradutt Joshi.
Mark Spritzler
ranger
Sheriff

Joined: Feb 05, 2001
Posts: 17249
    
    6

Spring has a special class called ActionSupport, which extends Struts Action class, but adds the functionality to get the Spring App Context. Just have your action classes extend that class.

For more info, you can go to the Springframework.org documentation page, or do a google search on "Spring ActionSupport" and I am sure you will find more information.

Good Luck, it is very simple to use, I am sure you will have no problems with it.

Mark


Perfect World Programming, LLC - Two Laptop Bag - Tube Organizer
How to Ask Questions the Smart Way FAQ
 
 
subject: Spring bean in strutsAction
 
Similar Threads
Spring Contaniner object - how to get in java
Why am I getting NoSuchBeanDefinition Exception? I am new to Spring!
lookup method injection question
getWebApplicationContext() w/ Struts
Aspectj and Spring - adding methods