Win a copy of Practical SVG this week in the HTML/CSS/JavaScript forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

Can we force JSf beans to call a specific method llike we do in Spring beans

 
suresh dasari
Ranch Hand
Posts: 121
Chrome Eclipse IDE Mac
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi All,

In instantiating Spring beans, we can force it to execute an init method, can we do the same for JSF bean instances, else is there any other way to force my jsf bean to execute one method before my page renders.

Any help is appreciated.


Thanks,
Suresh
 
Mark Reyes
Ranch Hand
Posts: 426
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,

Not sure regarding your use case but can you check if POSTCONSTRUCT can help you?

Just take note of the scope of your beans though.

Thanks
 
suresh dasari
Ranch Hand
Posts: 121
Chrome Eclipse IDE Mac
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi Mark,

Thanks for you reply.

so you mean I can configure JSF beans as Spring beans?
If that is allowed, I can force using post construct method to execute before my page renders.
 
suresh dasari
Ranch Hand
Posts: 121
Chrome Eclipse IDE Mac
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I tried and its working as expected

Thanks mark
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!