• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Spring bean in strutsAction

 
Rudradutt Joshi
Ranch Hand
Posts: 45
Fedora Google Web Toolkit Java
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 17278
6
IntelliJ IDE Mac Spring
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
 
It is sorta covered in the JavaRanch Style Guide.
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic