java - How to trigger an event when all the controllers are ready in Spring Context? -


i trying execute code in postconstruct of 1 controllers. action such cause 1 other controller same module triggered other external module. observed other controllers not ready when our code in postconstruct gets executed.

i tried out using applicationcontext listener on contextrefreshed , contextstarted event, still controllers don't seem ready time if external modules try contact them.

what missing? there hook available trigger method execution when controllers ready current module?

context refreshed event should work unless using lazy initialization (which not enabled default).

be sure listen correct context event. there 2 (or more) refresh events - 1 root context , 1 each servlet context.


Comments