• Post Reply Bookmark Topic Watch Topic
  • New Topic

Inject Interceptors from Spring  RSS feed

 
Antonio Fornie
Ranch Hand
Posts: 117
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hello.

I'm using Struts2 and Spring. I create the actions via Spring. The problem is I can't do the same with the interceptors. Does anybody know how to inject interceptors from Spring?

That's what I've done so far:
<!-- Struts' Interceptors -->
<bean id="groupInterceptor" scope="prototype"
class="web.interceptors.GroupInterceptor" >
<property name="groupService" ref="groupService"></property>
</bean>

And there's no problem with groupService when I use it in other beans as Actions.

Thank you very much.
 
Antonio Fornie
Ranch Hand
Posts: 117
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I've solved it. It was only because of a set method I didn't implement. Sorry. Creating Interceptors it's just as creting actions. I was afraid it was different and it wouldn't work.
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!