ViewScoped bean created multiple times?

2014-11-07 Thread Bjørn T Johansen
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

Re: ViewScoped bean created multiple times?

2014-11-07 Thread Kito Mann
Hello Bjorn, Do you have component bindings in your page (i.e h:myComponent binding=#{myBean.comp}/)? That causes the exact behavior you're describing in versions of JSF prior to 2.2. What version of MyFaces are you using? ___ Kito D. Mann | @kito99 | Author, JSF in Action Virtua, Inc. |

Re: ViewScoped bean created multiple times?

2014-11-07 Thread Howard W. Smith, Jr.
Interesting, you asked the same question in PrimeFaces forum. http://forum.primefaces.org/viewtopic.php?f=3t=40267 On Fri, Nov 7, 2014 at 3:42 PM, Bjørn T Johansen b...@havleik.no wrote: I trying to create a webapplication using request and/or viewscope instead of sessionscope, which I have

Re: ViewScoped bean created multiple times?

2014-11-07 Thread Bjørn T Johansen
No bindings... And using Myfaces 2.2.5 BTJ On Fri, 7 Nov 2014 15:57:00 -0500 Kito Mann kito.m...@virtua.com wrote: Hello Bjorn, Do you have component bindings in your page (i.e h:myComponent binding=#{myBean.comp}/)? That causes the exact behavior you're describing in versions of JSF

Re: ViewScoped bean created multiple times?

2014-11-07 Thread Bjørn T Johansen
Yes, I did.. But since I did not get any answer there and I thought that this was more a JSF question than a PrimeFaces question, I thought I should try here Was that wrong? BTJ On Fri, 7 Nov 2014 15:58:59 -0500 Howard W. Smith, Jr. smithh032...@gmail.com wrote: Interesting, you asked the

Re: ViewScoped bean created multiple times?

2014-11-07 Thread Howard W. Smith, Jr.
That's fine. Can you provide your XHTML and java bean definition (source code) here? You provided a little bit of your java bean in primefaces forum. Your XHTML and java bean may help us on this list to help you. On Fri, Nov 7, 2014 at 4:11 PM, Bjørn T Johansen b...@havleik.no wrote: Yes, I

Re: ViewScoped bean created multiple times?

2014-11-07 Thread Bjørn T Johansen
That I can do... :) Attached... BTJ On Fri, 7 Nov 2014 16:14:55 -0500 Howard W. Smith, Jr. smithh032...@gmail.com wrote: That's fine. Can you provide your XHTML and java bean definition (source code) here? You provided a little bit of your java bean in primefaces forum. Your XHTML and

Re: ViewScoped bean created multiple times?

2014-11-07 Thread Kito Mann
OK. What version do you have in your faces-config.xml file? Also, do you have javax.faces.PARTIAL_STATE_SAVING set to false in web.xml? ___ Kito D. Mann | @kito99 | Author, JSF in Action Virtua, Inc. | http://www.virtua.com | JSF/Java EE training and consulting http://www.JSFCentral.com |

Re: ViewScoped bean created multiple times?

2014-11-07 Thread Bjørn T Johansen
2.2, like this.: faces-config xmlns=http://xmlns.jcp.org/xml/ns/javaee; xmlns:xsi=http://www.w3.org/2001/XMLSchema-instance; xsi:schemaLocation=http://xmlns.jcp.org/xml/ns/javaee http://xmlns.jcp.org/xml/ns/javaee/web-facesconfig_2_2.xsd; version=2.2 No,

Re: ViewScoped bean created multiple times?

2014-11-07 Thread Thomas Andraschko
Constructor is called multiple times by design - thats how object serialization works. Serislization is enabled by default in myfaces to support clustering/failover. No clue about viewaction - i cant use jsf 2.2. Am Freitag, 7. November 2014 schrieb Bjørn T Johansen : 2.2, like this.:

Re: ViewScoped bean created multiple times?

2014-11-07 Thread Leonardo Uribe
Hi In my opinion, you should use @PostConstruct annotation over init method. But the code has an entry like this: @ManagedProperty(value=#{priceController}) private PriceController priceController; Since this is inside a view scope bean, PriceController instance is saved with the view