You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@myfaces.apache.org by "brian.waskiewicz" <br...@saic.com> on 2007/12/18 22:10:45 UTC

backing bean getting created/invoked twice?

I have a page which takes a request-scoped backing bean. I noticed that when
the page is loaded the backing bean gets created twice, then when the form
is submitted (using an h:commandButton with attached action) the bean gets
created twice again and the backing method gets called twice. We're using
myfaces, so we have the 1.2.0 myfaces JSF api and implementation on the
classpath (Sun's reference implementation isn't part of the war).

I'm pretty much at a loss on this, so any help would be great. Thanks.
-- 
View this message in context: http://www.nabble.com/backing-bean-getting-created-invoked-twice--tp14405647p14405647.html
Sent from the MyFaces - Users mailing list archive at Nabble.com.


Re: backing bean getting created/invoked twice?

Posted by jimmyau <ji...@privasia.com>.
I am using tomahawk 1.1.5. How to enable redirect tracker manager?


----- Original Message ----- 
From: "David Delbecq" <de...@oma.be>
To: "MyFaces Discussion" <us...@myfaces.apache.org>
Sent: Wednesday, December 19, 2007 6:23 PM
Subject: Re: backing bean getting created/invoked twice?


> If your navigation rules imply a <redirect/> and you don't have redirect
> tracker manager enabled (part of tomahawk), you woul indeed get 2
> request from browser and 2 invocation of backing beans:
>
> Browser: submit form (request 1)
> JSF: Received, apply request values (eventually create on demand request
> scoped beans), validate, execut action, get navigation rule, send a
> "redirect" to new location to browser
> Browser, gets the redirect rule, request the new location from JSF
> (request 2)
> JSF: receive a get, create view, eventually create request scoped beans
> on demand, render response.
>
> En l'instant précis du 18/12/07 22:10, brian.waskiewicz s'exprimait en
> ces termes:
>> I have a page which takes a request-scoped backing bean. I noticed that 
>> when
>> the page is loaded the backing bean gets created twice, then when the 
>> form
>> is submitted (using an h:commandButton with attached action) the bean 
>> gets
>> created twice again and the backing method gets called twice. We're using
>> myfaces, so we have the 1.2.0 myfaces JSF api and implementation on the
>> classpath (Sun's reference implementation isn't part of the war).
>>
>> I'm pretty much at a loss on this, so any help would be great. Thanks.
>>
>
>
> -- 
> http://www.devlog.be (a belgian developer's logs)
>
>
>
> -- 
> This message has been scanned for viruses and
> dangerous content by MailScanner, and is
> believed to be clean.
>
>
>
>
> -- 
> No virus found in this incoming message.
> Checked by AVG Free Edition.
> Version: 7.5.516 / Virus Database: 269.17.8/1195 - Release Date: 
> 12/24/2007 11:19 AM
>
> 


-- 
This message has been scanned for viruses and
dangerous content by MailScanner, and is
believed to be clean.


Re: backing bean getting created/invoked twice?

Posted by David Delbecq <de...@oma.be>.
If your navigation rules imply a <redirect/> and you don't have redirect
tracker manager enabled (part of tomahawk), you woul indeed get 2
request from browser and 2 invocation of backing beans:

Browser: submit form (request 1)
JSF: Received, apply request values (eventually create on demand request
scoped beans), validate, execut action, get navigation rule, send a
"redirect" to new location to browser
Browser, gets the redirect rule, request the new location from JSF
(request 2)
JSF: receive a get, create view, eventually create request scoped beans
on demand, render response.

En l'instant précis du 18/12/07 22:10, brian.waskiewicz s'exprimait en
ces termes:
> I have a page which takes a request-scoped backing bean. I noticed that when
> the page is loaded the backing bean gets created twice, then when the form
> is submitted (using an h:commandButton with attached action) the bean gets
> created twice again and the backing method gets called twice. We're using
> myfaces, so we have the 1.2.0 myfaces JSF api and implementation on the
> classpath (Sun's reference implementation isn't part of the war).
>
> I'm pretty much at a loss on this, so any help would be great. Thanks.
>   


-- 
http://www.devlog.be (a belgian developer's logs)