Return-Path: X-Original-To: apmail-myfaces-users-archive@www.apache.org Delivered-To: apmail-myfaces-users-archive@www.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id 0677317C8C for ; Sat, 8 Nov 2014 00:02:52 +0000 (UTC) Received: (qmail 2274 invoked by uid 500); 8 Nov 2014 00:02:51 -0000 Delivered-To: apmail-myfaces-users-archive@myfaces.apache.org Received: (qmail 2217 invoked by uid 500); 8 Nov 2014 00:02:51 -0000 Mailing-List: contact users-help@myfaces.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: "MyFaces Discussion" Delivered-To: mailing list users@myfaces.apache.org Received: (qmail 2202 invoked by uid 99); 8 Nov 2014 00:02:51 -0000 Received: from nike.apache.org (HELO nike.apache.org) (192.87.106.230) by apache.org (qpsmtpd/0.29) with ESMTP; Sat, 08 Nov 2014 00:02:51 +0000 X-ASF-Spam-Status: No, hits=2.9 required=5.0 tests=HTML_MESSAGE,RCVD_IN_DNSWL_LOW,SPF_PASS,URIBL_GREY,URIBL_RHS_DOB X-Spam-Check-By: apache.org Received-SPF: pass (nike.apache.org: domain of andraschko.thomas@gmail.com designates 209.85.223.169 as permitted sender) Received: from [209.85.223.169] (HELO mail-ie0-f169.google.com) (209.85.223.169) by apache.org (qpsmtpd/0.29) with ESMTP; Sat, 08 Nov 2014 00:02:20 +0000 Received: by mail-ie0-f169.google.com with SMTP id tr6so6244603ieb.14 for ; Fri, 07 Nov 2014 16:02:19 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :content-type; bh=UkCT9ScXR3/MQ428ohuv0U0gW+e8zfKABDaviBh0Vis=; b=yea1esZxeQLBXoUegUNgQpE3V6eHH9JeqLPVm9sudsJZDbLIJtLD7UwjVLneuC3O++ XClBRD/yFjlbrOzSPNCiN5qPvTelMXtXyVS9DtJmcNbjJPTxeUUp4ymhsWKkDb9TFnd0 LeM9kXbiV+tXlIk3Ea0QUWoNAylqb4iyuqRPXPxXlXtb9H8GetzrRhFpTE8atgQpV1xA +kIG63d39gwaDondOTDjgbEEY4odnHJyA+wjWMk96ehTbyHhzlfpFiMWzjpLa2VUaHV7 vXq9UvaApalHBEni/mn+pBnr0VA2Bdjk941bHBX+E7QKQ2tkOu8RIVn3dfUhf2G5TeMX K5Dw== MIME-Version: 1.0 X-Received: by 10.107.133.78 with SMTP id h75mr16602602iod.47.1415404939452; Fri, 07 Nov 2014 16:02:19 -0800 (PST) Received: by 10.107.16.208 with HTTP; Fri, 7 Nov 2014 16:02:19 -0800 (PST) In-Reply-To: <20141107222633.1ea04906@pennywise.havleik.no> References: <20141107214257.1465a20b@pennywise.havleik.no> <20141107220949.2a1f7555@pennywise.havleik.no> <20141107222633.1ea04906@pennywise.havleik.no> Date: Sat, 8 Nov 2014 01:02:19 +0100 Message-ID: Subject: Re: ViewScoped bean created multiple times? From: Thomas Andraschko To: MyFaces Discussion Content-Type: multipart/alternative; boundary=001a113ea6fca1271b05074da433 X-Virus-Checked: Checked by ClamAV on apache.org --001a113ea6fca1271b05074da433 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable 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=C3=B8rn T Johansen : > 2.2, like this.: > > xmlns:xsi=3D"http://www.w3.org/2001/XMLSchema-instance" > xsi:schemaLocation=3D"http://xmlns.jcp.org/xml/ns/javaee > http://xmlns.jcp.org/xml/ns/javaee/web-facesconfig_2_2.xsd" > version=3D"2.2"> > > > No, javax.faces.PARTIAL_STATE_SAVING is set to true... > > > BTJ > > On Fri, 7 Nov 2014 16:21:29 -0500 > Kito Mann > wrote: > > > OK. What version do you have in your faces-config.xml file? Also, do yo= u > > 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 | @jsfcentral > > +1 203-998-0403 > > > > * Listen to the Enterprise Java Newscast: *http:// > > enterprisejavanews.com > > * > > * JSFCentral Interviews Podcast: > > http://www.jsfcentral.com/resources/jsfcentralpodcasts/ > > * Sign up for the JSFCentral Newsletter: > http://oi.vresp.com/?fid=3Dac048d0e17 > > > > On Fri, Nov 7, 2014 at 4:09 PM, Bj=C3=B8rn T Johansen > wrote: > > > > > No bindings... And using Myfaces 2.2.5.... > > > > > > BTJ > > > > > > On Fri, 7 Nov 2014 15:57:00 -0500 > > > Kito Mann > wrote: > > > > > > > Hello Bjorn, > > > > > > > > Do you have component bindings in your page (i.e > > > binding=3D"#{myBean.comp}"/>)? That causes the exact behavior you'r= e > > > > 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. | http://www.virtua.com | JSF/Java EE training and > > > consulting > > > > http://www.JSFCentral.com | @jsfcentral > > > > +1 203-998-0403 > > > > > > > > * Listen to the Enterprise Java Newscast: *http:// > > > > enterprisejavanews.com > > > > * > > > > * JSFCentral Interviews Podcast: > > > > http://www.jsfcentral.com/resources/jsfcentralpodcasts/ > > > > * Sign up for the JSFCentral Newsletter: > > > http://oi.vresp.com/?fid=3Dac048d0e17 > > > > > > > > On Fri, Nov 7, 2014 at 3:42 PM, Bj=C3=B8rn T Johansen > wrote: > > > > > > > > > I trying to create a webapplication using request and/or viewscop= e > > > 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..: > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > ...... > > > > > > > > > > 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 t= he > > > init > > > > > method only once... > > > > > > > > > > What am I missing? > > > > > > > > > > > > > > > Regards, > > > > > > > > > > BTJ > > > > > -- > > > > > > > > > > > > > > -------------------------------------------------------------------------= ---------------------- > > > > > Bj=C3=B8rn 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" > > > > > > > > > > > > > > -------------------------------------------------------------------------= ---------------------- > > > > > > > > > > --001a113ea6fca1271b05074da433--