Hi Nikolaos,

> I guess what I need is a WAY to perform POST initialization on this 
> Spring managed Service object.  If I was dealing with an ActionBean then 
> an @AFTER on a particular life cycle event I imagine would do the trick 
> but this is not an Action Bean.

You are right, it is a bad idea to do any work in the constructor in
this case; you need to let Spring finish its wiring.

Indeed there is a standard annotation for doing post-initialization
work:
javax.annotation.PostConstruct. Spring recognizes this annotation when
its
annotation post processor is registered.[1]

So all you need is something like:

@PostConstruct
public void init() {
  // do initialization work
  // the name of the method can be something else than 'init'
}

I use this mechanism a lot and it works well.
Hope that helps.

Cheers,
Freddy

[1]:
http://static.springsource.org/spring/docs/2.5.x/reference/beans.html#beans-postconstruct-and-predestroy-annotations

------------------------------------------------------------------------------

_______________________________________________
Stripes-users mailing list
Stripes-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/stripes-users

Reply via email to