Win a copy of Java Concurrency Live Lessons this week in the Threads forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

JSF beans lifecycle postContruct initialize  RSS feed

 
Rahul Juneja
Ranch Hand
Posts: 425
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Folks,

I am having an application with Spring 2, JSF 1.2 and Hibernate. I have some backing beans which has some code which needs to be executed before the page is loaded. also the code which needs to be executed has some calls to spring bean which are accessed with 'DelegatingVariableResolver',

Presently i am resolving this with the call to the method in the first line in the jsp pages by calling. #{Bean1.init} but i am sure there is a better way to do it , which i am not able to find.

Any clues to this is highly appreciated.

Thanks.
Rahul
 
Rahul Juneja
Ranch Hand
Posts: 425
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thanks folks. I got my answer it is the postContruct annotation in the lifecycle. And it wasn't working before because i had a checked exception thrown from the initializing method.

Thanks,
Rahul
 
Consider Paul's rocket mass heater.
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!