You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@myfaces.apache.org by "ir. ing. Jan Dockx" <ja...@mac.com> on 2005/09/23 23:46:56 UTC

tree2 cookie confusion

Wait a sec. I have 2 trees in my application.

1 has only 1 level, so there are no nodes that can be expanded, so no  
cookie is ever generated.

               <x:tree2 id="schoolTree"
                        value="#{handler.schoolTree}"
                        var="node"
                        varNodeToggler="t"
                        showRootNode="false"
                        clientSideToggle="false">

It is in a page with viewId /jsf/be/peopleware/fvb/semantics/User.jspx.


The second one has multiple levels, that are expandable, so cookies are  
generated:

               <x:tree2 id="treeModel"
                        value="#{schoolH.treeModel}"
                        var="node"
                        varNodeToggler="t"
                        showRootNode="false">

This one is in a page with viewId  
/jsf/be/peopleware/fvb/semantics/convenants/School.jspx.

I navigate from the User.jspx page to School.jspx.


Then how come that, after I removed all (relevant cookies), that after  
a few minutes of moving around, I have TWO cookies named "treeModel"  
(and no cookie named "schoolTree", as expected), for 2 different paths  
"/<var>webappContext</var>/faces/jsf/be/peopleware/fvb/semantics" and  
"/<var>webappContext</var>/faces/jsf/be/peopleware/fvb/semantics/ 
convenants".

I presume the first is generated first, when navigating to the School  
page for the first time (because the URL is actually one step behind,  
because we navigate from the User page, which is one directory up)? But  
when I started editing and submitting information on the School page,  
the second one is generated? No wonder that we get weird behavior, with  
the tree unexpectedly expanding, and errors that nodes are not found,  
with 2 cookies.

What are we doing wrong? Is there a better way to do this? Shouldn't  
the cookies have the path of the web app, period, like the JSESSIONID?  
To keep them unique, the name of the cookie could contain the viewId,  
e.g..

BTW, the analysis above seems to indicate that we need to take care  
that the simple id (not the full, ":"-separated id) of a t:tree2  
component is UNIQUE inside a DIRECTORY of the web application!!!! (not  
only unique in its naming context, nor only unique inside 1 file).



Met vriendelijke groeten,

Jan Dockx

PeopleWare NV - Head Office
Cdt.Weynsstraat 85
B-2660 Hoboken
Tel: +32 3 448.33.38
Fax: +32 3 448.32.66

PeopleWare NV - Branch Office Geel
Kleinhoefstraat 5
B-2440 Geel
Tel: +32 14 57.00.90
Fax: +32 14 58.13.25

http://www.peopleware.be/
http://www.mobileware.be/

Re: tree2 cookie confusion

Posted by "ir. ing. Jan Dockx" <ja...@mac.com>.
Decided myself boldly that it is a bug :-) , and created a JIRA.


On 23 Sep 2005, at 23:46, ir. ing. Jan Dockx wrote:

> Wait a sec. I have 2 trees in my application.
>
> 1 has only 1 level, so there are no nodes that can be expanded, so no  
> cookie is ever generated.
>
>               <x:tree2 id="schoolTree"
>                        value="#{handler.schoolTree}"
>                        var="node"
>                        varNodeToggler="t"
>                        showRootNode="false"
>                        clientSideToggle="false">
>
> It is in a page with viewId /jsf/be/peopleware/fvb/semantics/User.jspx.
>
>
> The second one has multiple levels, that are expandable, so cookies  
> are generated:
>
>               <x:tree2 id="treeModel"
>                        value="#{schoolH.treeModel}"
>                        var="node"
>                        varNodeToggler="t"
>                        showRootNode="false">
>
> This one is in a page with viewId  
> /jsf/be/peopleware/fvb/semantics/convenants/School.jspx.
>
> I navigate from the User.jspx page to School.jspx.
>
>
> Then how come that, after I removed all (relevant cookies), that after  
> a few minutes of moving around, I have TWO cookies named "treeModel"  
> (and no cookie named "schoolTree", as expected), for 2 different paths  
> "/<var>webappContext</var>/faces/jsf/be/peopleware/fvb/semantics" and  
> "/<var>webappContext</var>/faces/jsf/be/peopleware/fvb/semantics/ 
> convenants".
>
> I presume the first is generated first, when navigating to the School  
> page for the first time (because the URL is actually one step behind,  
> because we navigate from the User page, which is one directory up)?  
> But when I started editing and submitting information on the School  
> page, the second one is generated? No wonder that we get weird  
> behavior, with the tree unexpectedly expanding, and errors that nodes  
> are not found, with 2 cookies.
>
> What are we doing wrong? Is there a better way to do this? Shouldn't  
> the cookies have the path of the web app, period, like the JSESSIONID?  
> To keep them unique, the name of the cookie could contain the viewId,  
> e.g..
>
> BTW, the analysis above seems to indicate that we need to take care  
> that the simple id (not the full, ":"-separated id) of a t:tree2  
> component is UNIQUE inside a DIRECTORY of the web application!!!! (not  
> only unique in its naming context, nor only unique inside 1 file).
>
>
>
> Met vriendelijke groeten,
>
> Jan Dockx
>
> PeopleWare NV - Head Office
> Cdt.Weynsstraat 85
> B-2660 Hoboken
> Tel: +32 3 448.33.38
> Fax: +32 3 448.32.66
>
> PeopleWare NV - Branch Office Geel
> Kleinhoefstraat 5
> B-2440 Geel
> Tel: +32 14 57.00.90
> Fax: +32 14 58.13.25
>
> http://www.peopleware.be/
> http://www.mobileware.be/
Met vriendelijke groeten,

Jan Dockx

PeopleWare NV - Head Office
Cdt.Weynsstraat 85
B-2660 Hoboken
Tel: +32 3 448.33.38
Fax: +32 3 448.32.66

PeopleWare NV - Branch Office Geel
Kleinhoefstraat 5
B-2440 Geel
Tel: +32 14 57.00.90
Fax: +32 14 58.13.25

http://www.peopleware.be/
http://www.mobileware.be/