• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Is struts2 Action class suppourts Dependency Injection featuture

 
RaviNada Kiran
Ranch Hand
Posts: 528
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator


Hi all,

I am using Struts2 independently ( what i mean is without using Spring)

Is it possible to refer to the sessionBean with the help of @EJB Annotation inside the Action class of struts?

Anybody please help.
 
RaviNada Kiran
Ranch Hand
Posts: 528
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Anybody on this ??
 
Ankit Garg
Sheriff
Posts: 9528
32
Android Google Web Toolkit Hibernate IntelliJ IDE Java Spring
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Ravi I'm not a pro at this but a google search took me to this page

http://www.tzavellas.com/techblog/2007/07/03/using-dependency-injection-in-struts2-for-stateless-ejbs-part-1/

I found a lot of other pages saying that this cannot be done but this page shows that. I have not tested it though...
 
RaviNada Kiran
Ranch Hand
Posts: 528
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Yes Ankit i also saw that link . But I think that going with Spring would be best .
 
Ankit Garg
Sheriff
Posts: 9528
32
Android Google Web Toolkit Hibernate IntelliJ IDE Java Spring
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
RaviNada Kiran wrote:Yes Ankit i also saw that link . But I think that going with Spring would be best .


Well the page that I gave uses a library to do the injection. You said that you are not using Spring that's why I gave that solution...
 
RaviNada Kiran
Ranch Hand
Posts: 528
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Yes what you said is right .
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic