aspose file tools
The moose likes Other Application Frameworks and the fly likes Spring bean in strutsAction Big Moose Saloon
  Search | Java FAQ | Recent Topics
Register / Login


Win a copy of The Mikado Method this week in the Agile and other Processes forum!
JavaRanch » Java Forums » Frameworks » Other Application Frameworks
Reply 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: 17233
    
    1

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
 
I agree. Here's the link: http://zeroturnaround.com/jrebel - it saves me about five hours per week
 
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!
Aspectj and Spring - adding methods
getWebApplicationContext() w/ Struts
lookup method injection question