0

I'm trying to populate a JSF view scoped bean before the page renders so I can see values from my web service displayed.

Currently I have an application bean that injects both my view and service beans. On PostConstruct it calls the service class (which calls my web service) to get the response and after populates the injected view bean.

At the moment, my approach doesn't seem to be working as no data is currently displayed. I'm wondering if PostConstruct is occurring after my pages are trying to call the getters from the view bean. Is this approach viable or should I be looking towards storing my web service response in a session variable, and populating the view bean in it's constructor? I'm trying to avoid using sessions or making one big managed bean to handle all display properties.

Ph33ly
  • 663
  • 3
  • 13
  • 29
  • 1
    The answer to your last question is NO. But to prevent downvotes for unclarity or no code read http://idownvotedbecau.se/nomcve/ and [mcve] – Kukeltje Jun 14 '18 at 20:10
  • Do some debugging and you won't be wondering it: https://stackoverflow.com/a/1804799/1199132 – Aritz Jun 15 '18 at 07:26

0 Answers0