PostConstruct gets called everytime on viewscoped/converstionscoped bean

Posted: November 21, 2012 in web

Issue:

PostConstruct gets called everytime on viewscoped/converstionscoped bean when you click a link

One Solution:

Make sure to not change the navigation on the current view. If you use someview?faces-redirect=true it will trigger PostConstruct all the time.

Issue:

PostConstruct gets called everytime on viewscoped bean when using when updating a component

One Solution:

Make us of type=”preRenderComponent” inside an include with a rendered attribute.

Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s