Hello Gerhard,

sorry that I not answered for so long. It was hard to reproduce the error I got.
Now, finally, I found the error-producing configuration.

If I set the MyFaces library to "development"-Mode via the web.xml-paramter:

   <context-param>
       <param-name>javax.faces.PROJECT_STAGE</param-name>
       <param-value>Development</param-value>
   </context-param>
AND I have view-Parameter in my Xhtml-Page, then the following behaviour takes 
happen:

I can open a new view (useCaseA.xhtml) and this will create a new bean. 
(useCaseABean).
Then I go to the shared use case and a new sharedUseCaseBean will be created.
No I go back and in the Restore-View-Phase the old useCaseABean will be 
destroyed and a new one will be created.

In UseCase B are no viewParameter and if I do the same actions in the UseCase B 
then the old bean is not destroyed while going back from the shared UseCase.

I do not know exactly, which component in the application is responsible for 
this behaviour. Since it depends on the PROJECT_STAGE parameter I think it is 
the myFaces library.
Can you reproduce it with this setting?
Greetings from Stuttgart,
Steven


-----Ursprüngliche Nachricht-----
Von: "Gerhard Petracek" <[email protected]>
Gesendet: Sep 1, 2011 11:43:15 PM
An: "MyFaces Discussion" <[email protected]>
Betreff: Re: FW: Re: CODI ViewAccessScope use-case in use-case approach

>hi steven,
>
>i've created a branch of the example (called viewparams) which illustrates
>the described use-case.
>i used the configured jetty plugin, but i can't reproduce the issue.
>
>regards,
>gerhard
>
>http://www.irian.at
>
>Your JSF powerhouse -
>JSF Consulting, Development and
>Courses in English and German
>
>Professional Support for Apache MyFaces
>
>
>
>2011/9/1 Steven Rudolf <[email protected]>
>
>> Hello Gerhard,
>>
>> thanks a lot for your help.
>> I tried out your example and it works fine. Of course :-)
>>
>> I tried to apply the logic to my own application and I was hopping mad
>> because I could not get it work!
>> Now I realised, that my problem is the viewParameter in my view.
>>
>> If I insert in your useCaseA.xhtml the following section (and of course the
>> value with getter and setter in the bean class):
>> <f:metadata>
>> <f:viewParam name="value" value="#{useCaseBeanA.value}" />
>> </f:metadata>
>>
>> Now the useCaseBeanA will be instantiate everytime I link to the
>> useCaseA.xhtml. (with faces-redirect)
>> Could you reproduce it?
>>
>> btw. I use the IBM WebSphere Application Server 8 (with apache myfaces as
>> JSF implementation). I could not get it work with jetty.
>>
>> Kind regards,
>> Steven
>>
>>
>> -----Ursprüngliche Nachricht-----
>> Von: "Gerhard Petracek" <[email protected]>
>> Gesendet: Aug 30, 2011 2:19:47 PM
>> An: "MyFaces Discussion" <[email protected]>
>> Betreff: Re: FW: Re: CODI ViewAccessScope use-case in use-case approach
>>
>> >hi steven,
>> >
>> >i've created a small demo [1] (including some comments) which illustrates
>> a
>> >possible solution.
>> >
>> >regards,
>> >gerhard
>> >
>> >[1] http://s.apache.org/Oaz
>> >
>> >http://www.irian.at
>> >
>> >Your JSF powerhouse -
>> >JSF Consulting, Development and
>> >Courses in English and German
>> >
>> >Professional Support for Apache MyFaces
>> >
>> >
>> >2011/8/30 Steven Rudolf <[email protected]>
>> >
>> >> Hello Gerhard,
>> >>
>> >> thanks for your effort!
>> >> Yes, Sorry, I described it not very well. I am really searching for a
>> >> generic solution.
>> >> I have many use-cases of type A and three or four use cases of type B
>> for
>> >> searching some entities. I do not want to inject all of the A-type-beans
>> >> into the B-type-beans because I want to code the B-types independently
>> from
>> >> the calling use-cases. Therefore I tried to use the "useCaseLinkBean".
>> >>
>> >> Kind regards,
>> >> Steven
>> >>
>> >>
>> >> -----Ursprüngliche Nachricht-----
>> >> Von: "Gerhard Petracek" <[email protected]>
>> >> Gesendet: Aug 29, 2011 4:58:13 PM
>> >> An: "MyFaces Discussion" <[email protected]>
>> >> Betreff: Re: FW: Re: CODI ViewAccessScope use-case in use-case approach
>> >>
>> >> >hi steven,
>> >> >
>> >> >that would make sense if it's a generic engine. if it isn't that
>> generic,
>> >> >you could directly inject "bean a" into "bean b" and access it.
>> >> >if you really access e.g. #toString of the "callerBean" it should work.
>> >> >
>> >> >the alternative depends on further details of your application and
>> >> >use-cases.
>> >> >
>> >> >if you aren't allowed to provide details about your application, we
>> could
>> >> >talk about the concrete constellation in our irc channel (afterwards we
>> >> post
>> >> >the basic solution).
>> >> >
>> >> >regards,
>> >> >gerhard
>> >> >
>> >> >http://www.irian.at
>> >> >
>> >> >Your JSF powerhouse -
>> >> >JSF Consulting, Development and
>> >> >Courses in English and German
>> >> >
>> >> >Professional Support for Apache MyFaces
>> >> >
>> >> >
>> >> >2011/8/29 Steven Rudolf <[email protected]>
>> >> >
>> >> >> Oh, I am deeply sorry for the bad format!
>> >> >> I hope you can read it better now:
>> >> >>
>> >> >> Hello Gerhard, thanks for the fast answer!
>> >> >>
>> >> >> I have an a.view with a commandlink like this:
>> >> >> <h:commandlink
>> action="#{useCaseLinkBean.accessUseCase('foreignUseCase',
>> >> >> aBean")}" />
>> >> >>
>> >> >> Then I have the useCaseLinkBean which handles the "routing" between
>> the
>> >> >> usecases with the method:
>> >> >> public String accessUseCase(final String accessLink, final
>> UseCaseCaller
>> >> >> callerBean) {
>> >> >> this.callerBean = callerBean;
>> >> >> return accessLink + "?faces-redirect=true";
>> >> >> }
>> >> >>
>> >> >> Now on the b.view I access the aBean in two ways.
>> >> >> The first is an outputText:
>> >> >> <h:outputText value="I came from #{useCaseLinkBean.callerBean}" />
>> >> >>
>> >> >> And the second is the back-link via a commandButton:
>> >> >> <h:commandButton
>> >> >>
>> >>
>> action="#{useCaseLinkBean.callerBean.returnWithResult(bBean.returnObject)}"
>> >> >> />
>> >> >>
>> >> >> Do I have to access the aBean in some other way to not break the
>> >> >> assignement of aView to aBean instance?
>> >> >> The using of a "routing" bean is not so clever as well. Maybe there
>> is a
>> >> >> more elegant way?
>> >> >>
>> >> >> Greetings from Stuttgart,
>> >> >> Steven
>> >> >>
>> >> >>
>> >> >>
>> >> >> -----Ursprüngliche Nachricht-----
>> >> >> Von: "Steven Rudolf" <[email protected]>
>> >> >> Gesendet: Aug 29, 2011 4:21:36 PM
>> >> >> An: "MyFaces Discussion" <[email protected]>
>> >> >> Betreff: Re: CODI ViewAccessScope use-case in use-case approach
>> >> >>
>> >> >> >Hello Gerhard, thanks for the fast answer! I have an a.view with a
>> >> >> commandlink like this: Then I have the useCaseLinkBean which handles
>> the
>> >> >> "routing" between the usecases the method: public String
>> >> accessUseCase(final
>> >> >> String accessLink, final UseCaseCaller callerBean) { this.callerBean
>> =
>> >> >> callerBean; return accessLink + "?faces-redirect=true"; } Now on the
>> >> b.view
>> >> >> I access the aBean in two ways. The first is an outputText: And the
>> >> second
>> >> >> is the back-link via a commandButton: Do I have to access the aBean
>> in
>> >> some
>> >> >> other way to not break the assignement of aView to aBean instance?
>> The
>> >> using
>> >> >> of a "routing" bean is not so clever as well. Maybe there is a more
>> >> elegant
>> >> >> way? Greetings from Stuttgart, Steven
>> >> >> >
>> >> >> >
>> >> >> >-----Ursprüngliche Nachricht-----
>> >> >> >Von: "Gerhard Petracek" <[email protected]>
>> >> >> >Gesendet: Aug 29, 2011 3:20:09 PM
>> >> >> >An: "MyFaces Discussion" <[email protected]>
>> >> >> >Betreff: Re: CODI ViewAccessScope use-case in use-case approach
>> >> >> >
>> >> >> >>hi steven,
>> >> >> >>
>> >> >> >>first of all: welcome @ myfaces!
>> >> >> >>
>> >> >> >>please provide more information on how you touch the bean of your
>> >> first
>> >> >> >>use-case (A).
>> >> >> >>
>> >> >> >>regards,
>> >> >> >>gerhard
>> >> >> >>
>> >> >> >>http://www.irian.at
>> >> >> >>
>> >> >> >>Your JSF powerhouse -
>> >> >> >>JSF Consulting, Development and
>> >> >> >>Courses in English and German
>> >> >> >>
>> >> >> >>Professional Support for Apache MyFaces
>> >> >> >>
>> >> >> >>
>> >> >> >>2011/8/29 Steven Rudolf <[email protected]>
>> >> >> >>
>> >> >> >>> Hello,
>> >> >> >>>
>> >> >> >>> I'm using CODI (v 1.0.1) and I'm loving the ViewAccessScope
>> becaue
>> >> it
>> >> >> is
>> >> >> >>> really easy to program my use cases if I know, that the beans
>> will
>> >> >> clean up
>> >> >> >>> if I don't access them anymore after redirecting to the next
>> view.
>> >> So
>> >> >> mainly
>> >> >> >>> all my beans are ViewAccessScope and the transfer of values
>> between
>> >> >> screens
>> >> >> >>> works with viewParams.
>> >> >> >>>
>> >> >> >>> Now I have an "use case in use case" approach, where I have to
>> link
>> >> >> from
>> >> >> >>> one use case (A) to another screen (B) only for searching an
>> entity
>> >> and
>> >> >> then
>> >> >> >>> link back to the calling use case (A). I realized it with a
>> simple
>> >> >> redirect
>> >> >> >>> and I access the A-Bean from the B-view with a ping-method so
>> that
>> >> the
>> >> >> >>> A-Bean will not be destroyed. But if I link back to the A-view
>> then
>> >> a
>> >> >> new
>> >> >> >>> A-Bean will be created because the A-view doesn't know the old
>> >> A-Bean
>> >> >> >>> anymore.
>> >> >> >>>
>> >> >> >>> I think that the assignement of bean to view is destroyed after
>> >> >> redirecting
>> >> >> >>> to B-view so that the render of A-view will create a new A-Bean.
>> >> After
>> >> >> >>> looking to the CODI sources I think that will be done in
>> >> >> >>>
>> >> >>
>> >>
>> org.apache.myfaces.extensions.cdi.jsf.impl.scope.conversation.ViewAccessConversationExpirationEvaluator.
>> >> >> >>>
>> >> >> >>> How can I program my use-case? Is there a
>> >> >> >>> ViewAccess-ExceptOneSpecialLink-Scope poossible? Maybe I can
>> write a
>> >> >> >>> PhaseListener where I can plant the old A-Bean to the new
>> rendered
>> >> >> A-view?
>> >> >> >>>
>> >> >> >>> Respectfully,
>> >> >> >>> Steven Rudolf
>> >> >> >>>
>> >> >> >>> ___________________________________________________________
>> >> >> >>> Schon gehört? WEB.DE hat einen genialen Phishing-Filter in die
>> >> >> >>> Toolbar eingebaut! http://produkte.web.de/go/toolbar
>> >> >> >>>
>> >> >> >
>> >> >>
>> >> >>
>> >> >> ___________________________________________________________
>> >> >> Schon gehört? WEB.DE hat einen genialen Phishing-Filter in die
>> >> >> Toolbar eingebaut! http://produkte.web.de/go/toolbar
>> >> >>
>> >>
>> >>
>> >> ___________________________________________________________
>> >> Schon gehört? WEB.DE hat einen genialen Phishing-Filter in die
>> >> Toolbar eingebaut! http://produkte.web.de/go/toolbar
>> >>
>>
>>
>> ___________________________________________________________
>> Schon gehört? WEB.DE hat einen genialen Phishing-Filter in die
>> Toolbar eingebaut! http://produkte.web.de/go/toolbar
>>


___________________________________________________________
Schon gehört? WEB.DE hat einen genialen Phishing-Filter in die
Toolbar eingebaut! http://produkte.web.de/go/toolbar

Reply via email to