myfaces-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Howard W. Smith, Jr." <smithh032...@gmail.com>
Subject Re: ViewScoped bean created multiple times?
Date Fri, 07 Nov 2014 20:58:59 GMT
Interesting, you asked the same question in PrimeFaces forum.

http://forum.primefaces.org/viewtopic.php?f=3&t=40267


On Fri, Nov 7, 2014 at 3:42 PM, Bjørn T Johansen <btj@havleik.no> wrote:

> I trying to create a webapplication using request and/or viewscope instead
> of sessionscope, which I have always used... (Neved needed to concern
> myself with memory usage in the apps I have implemented.. :) )
> But I now have a problem using @ViewScoped..
> When I access index.xhtml which uses a managed bean in viewscope, the
> constructor is called multiple times. And the same with an init method, that
> should be called only once. I am using..:
>
> <f:metadata>
>     <f:viewAction action="#{calendarController.initPrices}" />
> </f:metadata>
>
> <h:head>......
>
> to call the init method, but I have also tried using f:event prerenderView
> and also @PostConstruct but I am not able to make the bean call the init
> method only once...
>
> What am I missing?
>
>
> Regards,
>
> BTJ
> --
>
> -----------------------------------------------------------------------------------------------
> Bjørn T Johansen
>
> btj@havleik.no
>
> -----------------------------------------------------------------------------------------------
> Someone wrote:
> "I understand that if you play a Windows CD backwards you hear strange
> Satanic messages"
> To which someone replied:
> "It's even worse than that; play it forwards and it installs Windows"
>
> -----------------------------------------------------------------------------------------------
>

Mime
  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message