You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@myfaces.apache.org by behrangsa <be...@gmail.com> on 2006/11/16 03:12:14 UTC

javax.servlet.ServletException: Client-id : _idJsp0 is duplicated in the faces tree.

Hi,

When I modify a JSP (add/remove some children to a panelGrid,etc.) and press
F5 to see the changes, I get the following exception in Tomcat 5.5.17 or
5.5.20:

javax.faces.FacesException: Client-id : _idJsp0 is duplicated in the faces
tree. Component : _idJsp0, path: {Component-Path : [Class:
javax.faces.component.UIViewRoot,ViewId: /position/index.jsp][Class:
javax.faces.component.html.HtmlPanelGrid,Id: positionPane][Class:
javax.faces.component.html.HtmlPanelGrid,Id: ositionTitlePane][Class:
javax.faces.component.html.HtmlOutputText,Id: _idJsp0]}

org.apache.myfaces.context.servlet.ServletExternalContextImpl.dispatch(ServletExternalContextImpl.java:422)

org.apache.myfaces.application.jsp.JspViewHandlerImpl.renderView(JspViewHandlerImpl.java:234)
	org.apache.myfaces.lifecycle.LifecycleImpl.render(LifecycleImpl.java:384)
	javax.faces.webapp.FacesServlet.service(FacesServlet.java:138)

The second time I press F5, everything starts working fine again. Any ideas
how can I overcome this problem?

Also, sometimes when I change the value attribute of an outputText and press
F5 to see the changes, the changes are not reflected... any ideas what
should I do to make these glitches go away?

Regards,
Behi
-- 
View this message in context: http://www.nabble.com/javax.servlet.ServletException%3A-Client-id-%3A-_idJsp0-is-duplicated-in-the-faces-tree.-tf2640305.html#a7370404
Sent from the MyFaces - Users mailing list archive at Nabble.com.


Re: javax.servlet.ServletException: Client-id : _idJsp0 is duplicated in the faces tree.

Posted by Matthias Wessendorf <ma...@apache.org>.
the latest 5.5.xx
(not 6.xxx)

On 11/16/06, Matthias Wessendorf <ma...@apache.org> wrote:
> can you try latest tomcat?
> I am not really sure about that, but worth a try, right ?
>
> On 11/16/06, behrangsa <be...@gmail.com> wrote:
> >
> > Hi again,
> >
> > Even setting the keepgenerated init-param for the JSP to false won't fix the
> > problem.
> >
> > (MyFace 1.1.3 Core + Tomcat 5.5.12)
> >
> > Regards,
> > Behi
> >
> >
> >
> > behrangsa wrote:
> > >
> > > Hi,
> > >
> > > I think you are right, but how can I fix the behavior of the "work"
> > > directory?
> > >
> > > Regards,
> > > Behi
> > >
> > > Matthias Wessendorf-4 wrote:
> > >>
> > >> I am not sure,
> > >> perhaps that is related to the "work" directory of tomcat ?
> > >>
> > >>
> > >> On 11/16/06, behrangsa <be...@gmail.com> wrote:
> > >>>
> > >>> Hi,
> > >>>
> > >>> When I modify a JSP (add/remove some children to a panelGrid,etc.) and
> > >>> press
> > >>> F5 to see the changes, I get the following exception in Tomcat 5.5.17 or
> > >>> 5.5.20:
> > >>>
> > >>> javax.faces.FacesException: Client-id : _idJsp0 is duplicated in the
> > >>> faces
> > >>> tree. Component : _idJsp0, path: {Component-Path : [Class:
> > >>> javax.faces.component.UIViewRoot,ViewId: /position/index.jsp][Class:
> > >>> javax.faces.component.html.HtmlPanelGrid,Id: positionPane][Class:
> > >>> javax.faces.component.html.HtmlPanelGrid,Id: ositionTitlePane][Class:
> > >>> javax.faces.component.html.HtmlOutputText,Id: _idJsp0]}
> > >>>
> > >>> org.apache.myfaces.context.servlet.ServletExternalContextImpl.dispatch(ServletExternalContextImpl.java:422)
> > >>>
> > >>> org.apache.myfaces.application.jsp.JspViewHandlerImpl.renderView(JspViewHandlerImpl.java:234)
> > >>>
> > >>> org.apache.myfaces.lifecycle.LifecycleImpl.render(LifecycleImpl.java:384)
> > >>>         javax.faces.webapp.FacesServlet.service(FacesServlet.java:138)
> > >>>
> > >>> The second time I press F5, everything starts working fine again. Any
> > >>> ideas
> > >>> how can I overcome this problem?
> > >>>
> > >>> Also, sometimes when I change the value attribute of an outputText and
> > >>> press
> > >>> F5 to see the changes, the changes are not reflected... any ideas what
> > >>> should I do to make these glitches go away?
> > >>>
> > >>> Regards,
> > >>> Behi
> > >>> --
> > >>> View this message in context:
> > >>> http://www.nabble.com/javax.servlet.ServletException%3A-Client-id-%3A-_idJsp0-is-duplicated-in-the-faces-tree.-tf2640305.html#a7370404
> > >>> Sent from the MyFaces - Users mailing list archive at Nabble.com.
> > >>>
> > >>>
> > >>
> > >>
> > >> --
> > >> Matthias Wessendorf
> > >> http://tinyurl.com/fmywh
> > >>
> > >> further stuff:
> > >> blog: http://jroller.com/page/mwessendorf
> > >> mail: mwessendorf-at-gmail-dot-com
> > >>
> > >>
> > >
> > >
> >
> > --
> > View this message in context: http://www.nabble.com/javax.servlet.ServletException%3A-Client-id-%3A-_idJsp0-is-duplicated-in-the-faces-tree.-tf2640305.html#a7376883
> > Sent from the MyFaces - Users mailing list archive at Nabble.com.
> >
> >
>
>
> --
> Matthias Wessendorf
> http://tinyurl.com/fmywh
>
> further stuff:
> blog: http://jroller.com/page/mwessendorf
> mail: mwessendorf-at-gmail-dot-com
>


-- 
Matthias Wessendorf
http://tinyurl.com/fmywh

further stuff:
blog: http://jroller.com/page/mwessendorf
mail: mwessendorf-at-gmail-dot-com

Re: javax.servlet.ServletException: Client-id : _idJsp0 is duplicated in the faces tree.

Posted by Matthias Wessendorf <ma...@apache.org>.
can you try latest tomcat?
I am not really sure about that, but worth a try, right ?

On 11/16/06, behrangsa <be...@gmail.com> wrote:
>
> Hi again,
>
> Even setting the keepgenerated init-param for the JSP to false won't fix the
> problem.
>
> (MyFace 1.1.3 Core + Tomcat 5.5.12)
>
> Regards,
> Behi
>
>
>
> behrangsa wrote:
> >
> > Hi,
> >
> > I think you are right, but how can I fix the behavior of the "work"
> > directory?
> >
> > Regards,
> > Behi
> >
> > Matthias Wessendorf-4 wrote:
> >>
> >> I am not sure,
> >> perhaps that is related to the "work" directory of tomcat ?
> >>
> >>
> >> On 11/16/06, behrangsa <be...@gmail.com> wrote:
> >>>
> >>> Hi,
> >>>
> >>> When I modify a JSP (add/remove some children to a panelGrid,etc.) and
> >>> press
> >>> F5 to see the changes, I get the following exception in Tomcat 5.5.17 or
> >>> 5.5.20:
> >>>
> >>> javax.faces.FacesException: Client-id : _idJsp0 is duplicated in the
> >>> faces
> >>> tree. Component : _idJsp0, path: {Component-Path : [Class:
> >>> javax.faces.component.UIViewRoot,ViewId: /position/index.jsp][Class:
> >>> javax.faces.component.html.HtmlPanelGrid,Id: positionPane][Class:
> >>> javax.faces.component.html.HtmlPanelGrid,Id: ositionTitlePane][Class:
> >>> javax.faces.component.html.HtmlOutputText,Id: _idJsp0]}
> >>>
> >>> org.apache.myfaces.context.servlet.ServletExternalContextImpl.dispatch(ServletExternalContextImpl.java:422)
> >>>
> >>> org.apache.myfaces.application.jsp.JspViewHandlerImpl.renderView(JspViewHandlerImpl.java:234)
> >>>
> >>> org.apache.myfaces.lifecycle.LifecycleImpl.render(LifecycleImpl.java:384)
> >>>         javax.faces.webapp.FacesServlet.service(FacesServlet.java:138)
> >>>
> >>> The second time I press F5, everything starts working fine again. Any
> >>> ideas
> >>> how can I overcome this problem?
> >>>
> >>> Also, sometimes when I change the value attribute of an outputText and
> >>> press
> >>> F5 to see the changes, the changes are not reflected... any ideas what
> >>> should I do to make these glitches go away?
> >>>
> >>> Regards,
> >>> Behi
> >>> --
> >>> View this message in context:
> >>> http://www.nabble.com/javax.servlet.ServletException%3A-Client-id-%3A-_idJsp0-is-duplicated-in-the-faces-tree.-tf2640305.html#a7370404
> >>> Sent from the MyFaces - Users mailing list archive at Nabble.com.
> >>>
> >>>
> >>
> >>
> >> --
> >> Matthias Wessendorf
> >> http://tinyurl.com/fmywh
> >>
> >> further stuff:
> >> blog: http://jroller.com/page/mwessendorf
> >> mail: mwessendorf-at-gmail-dot-com
> >>
> >>
> >
> >
>
> --
> View this message in context: http://www.nabble.com/javax.servlet.ServletException%3A-Client-id-%3A-_idJsp0-is-duplicated-in-the-faces-tree.-tf2640305.html#a7376883
> Sent from the MyFaces - Users mailing list archive at Nabble.com.
>
>


-- 
Matthias Wessendorf
http://tinyurl.com/fmywh

further stuff:
blog: http://jroller.com/page/mwessendorf
mail: mwessendorf-at-gmail-dot-com

Re: javax.servlet.ServletException: Client-id : _idJsp0 is duplicated in the faces tree.

Posted by behrangsa <be...@gmail.com>.
Hi again,

Even setting the keepgenerated init-param for the JSP to false won't fix the
problem.

(MyFace 1.1.3 Core + Tomcat 5.5.12)

Regards,
Behi



behrangsa wrote:
> 
> Hi,
> 
> I think you are right, but how can I fix the behavior of the "work"
> directory?
> 
> Regards,
> Behi
> 
> Matthias Wessendorf-4 wrote:
>> 
>> I am not sure,
>> perhaps that is related to the "work" directory of tomcat ?
>> 
>> 
>> On 11/16/06, behrangsa <be...@gmail.com> wrote:
>>>
>>> Hi,
>>>
>>> When I modify a JSP (add/remove some children to a panelGrid,etc.) and
>>> press
>>> F5 to see the changes, I get the following exception in Tomcat 5.5.17 or
>>> 5.5.20:
>>>
>>> javax.faces.FacesException: Client-id : _idJsp0 is duplicated in the
>>> faces
>>> tree. Component : _idJsp0, path: {Component-Path : [Class:
>>> javax.faces.component.UIViewRoot,ViewId: /position/index.jsp][Class:
>>> javax.faces.component.html.HtmlPanelGrid,Id: positionPane][Class:
>>> javax.faces.component.html.HtmlPanelGrid,Id: ositionTitlePane][Class:
>>> javax.faces.component.html.HtmlOutputText,Id: _idJsp0]}
>>>
>>> org.apache.myfaces.context.servlet.ServletExternalContextImpl.dispatch(ServletExternalContextImpl.java:422)
>>>
>>> org.apache.myfaces.application.jsp.JspViewHandlerImpl.renderView(JspViewHandlerImpl.java:234)
>>>        
>>> org.apache.myfaces.lifecycle.LifecycleImpl.render(LifecycleImpl.java:384)
>>>         javax.faces.webapp.FacesServlet.service(FacesServlet.java:138)
>>>
>>> The second time I press F5, everything starts working fine again. Any
>>> ideas
>>> how can I overcome this problem?
>>>
>>> Also, sometimes when I change the value attribute of an outputText and
>>> press
>>> F5 to see the changes, the changes are not reflected... any ideas what
>>> should I do to make these glitches go away?
>>>
>>> Regards,
>>> Behi
>>> --
>>> View this message in context:
>>> http://www.nabble.com/javax.servlet.ServletException%3A-Client-id-%3A-_idJsp0-is-duplicated-in-the-faces-tree.-tf2640305.html#a7370404
>>> Sent from the MyFaces - Users mailing list archive at Nabble.com.
>>>
>>>
>> 
>> 
>> -- 
>> Matthias Wessendorf
>> http://tinyurl.com/fmywh
>> 
>> further stuff:
>> blog: http://jroller.com/page/mwessendorf
>> mail: mwessendorf-at-gmail-dot-com
>> 
>> 
> 
> 

-- 
View this message in context: http://www.nabble.com/javax.servlet.ServletException%3A-Client-id-%3A-_idJsp0-is-duplicated-in-the-faces-tree.-tf2640305.html#a7376883
Sent from the MyFaces - Users mailing list archive at Nabble.com.


Re: javax.servlet.ServletException: Client-id : _idJsp0 is duplicated in the faces tree.

Posted by Matthias Wessendorf <ma...@apache.org>.
ask the tomcat guys :)
(I use jetty for development)

On 11/16/06, behrangsa <be...@gmail.com> wrote:
>
> Hi,
>
> I think you are right, but how can I fix the behavior of the "work"
> directory?
>
> Regards,
> Behi
>
> Matthias Wessendorf-4 wrote:
> >
> > I am not sure,
> > perhaps that is related to the "work" directory of tomcat ?
> >
> >
> > On 11/16/06, behrangsa <be...@gmail.com> wrote:
> >>
> >> Hi,
> >>
> >> When I modify a JSP (add/remove some children to a panelGrid,etc.) and
> >> press
> >> F5 to see the changes, I get the following exception in Tomcat 5.5.17 or
> >> 5.5.20:
> >>
> >> javax.faces.FacesException: Client-id : _idJsp0 is duplicated in the
> >> faces
> >> tree. Component : _idJsp0, path: {Component-Path : [Class:
> >> javax.faces.component.UIViewRoot,ViewId: /position/index.jsp][Class:
> >> javax.faces.component.html.HtmlPanelGrid,Id: positionPane][Class:
> >> javax.faces.component.html.HtmlPanelGrid,Id: ositionTitlePane][Class:
> >> javax.faces.component.html.HtmlOutputText,Id: _idJsp0]}
> >>
> >> org.apache.myfaces.context.servlet.ServletExternalContextImpl.dispatch(ServletExternalContextImpl.java:422)
> >>
> >> org.apache.myfaces.application.jsp.JspViewHandlerImpl.renderView(JspViewHandlerImpl.java:234)
> >>
> >> org.apache.myfaces.lifecycle.LifecycleImpl.render(LifecycleImpl.java:384)
> >>         javax.faces.webapp.FacesServlet.service(FacesServlet.java:138)
> >>
> >> The second time I press F5, everything starts working fine again. Any
> >> ideas
> >> how can I overcome this problem?
> >>
> >> Also, sometimes when I change the value attribute of an outputText and
> >> press
> >> F5 to see the changes, the changes are not reflected... any ideas what
> >> should I do to make these glitches go away?
> >>
> >> Regards,
> >> Behi
> >> --
> >> View this message in context:
> >> http://www.nabble.com/javax.servlet.ServletException%3A-Client-id-%3A-_idJsp0-is-duplicated-in-the-faces-tree.-tf2640305.html#a7370404
> >> Sent from the MyFaces - Users mailing list archive at Nabble.com.
> >>
> >>
> >
> >
> > --
> > Matthias Wessendorf
> > http://tinyurl.com/fmywh
> >
> > further stuff:
> > blog: http://jroller.com/page/mwessendorf
> > mail: mwessendorf-at-gmail-dot-com
> >
> >
>
> --
> View this message in context: http://www.nabble.com/javax.servlet.ServletException%3A-Client-id-%3A-_idJsp0-is-duplicated-in-the-faces-tree.-tf2640305.html#a7376820
> Sent from the MyFaces - Users mailing list archive at Nabble.com.
>
>


-- 
Matthias Wessendorf
http://tinyurl.com/fmywh

further stuff:
blog: http://jroller.com/page/mwessendorf
mail: mwessendorf-at-gmail-dot-com

Re: javax.servlet.ServletException: Client-id : _idJsp0 is duplicated in the faces tree.

Posted by behrangsa <be...@gmail.com>.
Hi,

I think you are right, but how can I fix the behavior of the "work"
directory?

Regards,
Behi

Matthias Wessendorf-4 wrote:
> 
> I am not sure,
> perhaps that is related to the "work" directory of tomcat ?
> 
> 
> On 11/16/06, behrangsa <be...@gmail.com> wrote:
>>
>> Hi,
>>
>> When I modify a JSP (add/remove some children to a panelGrid,etc.) and
>> press
>> F5 to see the changes, I get the following exception in Tomcat 5.5.17 or
>> 5.5.20:
>>
>> javax.faces.FacesException: Client-id : _idJsp0 is duplicated in the
>> faces
>> tree. Component : _idJsp0, path: {Component-Path : [Class:
>> javax.faces.component.UIViewRoot,ViewId: /position/index.jsp][Class:
>> javax.faces.component.html.HtmlPanelGrid,Id: positionPane][Class:
>> javax.faces.component.html.HtmlPanelGrid,Id: ositionTitlePane][Class:
>> javax.faces.component.html.HtmlOutputText,Id: _idJsp0]}
>>
>> org.apache.myfaces.context.servlet.ServletExternalContextImpl.dispatch(ServletExternalContextImpl.java:422)
>>
>> org.apache.myfaces.application.jsp.JspViewHandlerImpl.renderView(JspViewHandlerImpl.java:234)
>>        
>> org.apache.myfaces.lifecycle.LifecycleImpl.render(LifecycleImpl.java:384)
>>         javax.faces.webapp.FacesServlet.service(FacesServlet.java:138)
>>
>> The second time I press F5, everything starts working fine again. Any
>> ideas
>> how can I overcome this problem?
>>
>> Also, sometimes when I change the value attribute of an outputText and
>> press
>> F5 to see the changes, the changes are not reflected... any ideas what
>> should I do to make these glitches go away?
>>
>> Regards,
>> Behi
>> --
>> View this message in context:
>> http://www.nabble.com/javax.servlet.ServletException%3A-Client-id-%3A-_idJsp0-is-duplicated-in-the-faces-tree.-tf2640305.html#a7370404
>> Sent from the MyFaces - Users mailing list archive at Nabble.com.
>>
>>
> 
> 
> -- 
> Matthias Wessendorf
> http://tinyurl.com/fmywh
> 
> further stuff:
> blog: http://jroller.com/page/mwessendorf
> mail: mwessendorf-at-gmail-dot-com
> 
> 

-- 
View this message in context: http://www.nabble.com/javax.servlet.ServletException%3A-Client-id-%3A-_idJsp0-is-duplicated-in-the-faces-tree.-tf2640305.html#a7376820
Sent from the MyFaces - Users mailing list archive at Nabble.com.


Re: javax.servlet.ServletException: Client-id : _idJsp0 is duplicated in the faces tree.

Posted by Matthias Wessendorf <ma...@apache.org>.
I am not sure,
perhaps that is related to the "work" directory of tomcat ?


On 11/16/06, behrangsa <be...@gmail.com> wrote:
>
> Hi,
>
> When I modify a JSP (add/remove some children to a panelGrid,etc.) and press
> F5 to see the changes, I get the following exception in Tomcat 5.5.17 or
> 5.5.20:
>
> javax.faces.FacesException: Client-id : _idJsp0 is duplicated in the faces
> tree. Component : _idJsp0, path: {Component-Path : [Class:
> javax.faces.component.UIViewRoot,ViewId: /position/index.jsp][Class:
> javax.faces.component.html.HtmlPanelGrid,Id: positionPane][Class:
> javax.faces.component.html.HtmlPanelGrid,Id: ositionTitlePane][Class:
> javax.faces.component.html.HtmlOutputText,Id: _idJsp0]}
>
> org.apache.myfaces.context.servlet.ServletExternalContextImpl.dispatch(ServletExternalContextImpl.java:422)
>
> org.apache.myfaces.application.jsp.JspViewHandlerImpl.renderView(JspViewHandlerImpl.java:234)
>         org.apache.myfaces.lifecycle.LifecycleImpl.render(LifecycleImpl.java:384)
>         javax.faces.webapp.FacesServlet.service(FacesServlet.java:138)
>
> The second time I press F5, everything starts working fine again. Any ideas
> how can I overcome this problem?
>
> Also, sometimes when I change the value attribute of an outputText and press
> F5 to see the changes, the changes are not reflected... any ideas what
> should I do to make these glitches go away?
>
> Regards,
> Behi
> --
> View this message in context: http://www.nabble.com/javax.servlet.ServletException%3A-Client-id-%3A-_idJsp0-is-duplicated-in-the-faces-tree.-tf2640305.html#a7370404
> Sent from the MyFaces - Users mailing list archive at Nabble.com.
>
>


-- 
Matthias Wessendorf
http://tinyurl.com/fmywh

further stuff:
blog: http://jroller.com/page/mwessendorf
mail: mwessendorf-at-gmail-dot-com

Re: javax.servlet.ServletException: Client-id : _idJsp0 is duplicated in the faces tree.

Posted by behrangsa <be...@gmail.com>.
Thorbjørn,

I have actually embraced this procedure as well. Very cumbersome and awkward
though. Also, as suggested by a few fellows, I tried Facelets 1.0.x with
MyFaces but I think I faced similar problems... I have to investigate a
little bit further though.

Regards,
Behi


Thorbjørn Ravn Andersen wrote:
> 
> behrangsa skrev  den 16-11-2006 03:12:
>> Also, sometimes when I change the value attribute of an outputText and
>> press
>> F5 to see the changes, the changes are not reflected... any ideas what
>> should I do to make these glitches go away?
>>   
> I have only found the work-around to give the surrounding h:form an id 
> attribute where I change the value manually when making an update.
> 
> This will apparently make myfaces unconditionally reconstruct the 
> internal representation.
> 
> -- 
>   Thorbjørn
> 
>  
> 

-- 
View this message in context: http://www.nabble.com/javax.servlet.ServletException%3A-Client-id-%3A-_idJsp0-is-duplicated-in-the-faces-tree.-tf2640305.html#a7642263
Sent from the MyFaces - Users mailing list archive at Nabble.com.


Re: javax.servlet.ServletException: Client-id : _idJsp0 is duplicated in the faces tree.

Posted by Thorbjørn Ravn Andersen <th...@gmail.com>.
behrangsa skrev  den 16-11-2006 03:12:
> Also, sometimes when I change the value attribute of an outputText and press
> F5 to see the changes, the changes are not reflected... any ideas what
> should I do to make these glitches go away?
>   
I have only found the work-around to give the surrounding h:form an id 
attribute where I change the value manually when making an update.

This will apparently make myfaces unconditionally reconstruct the 
internal representation.

-- 
  Thorbjørn

Re: javax.servlet.ServletException: Client-id : _idJsp0 is duplicated in the faces tree.

Posted by Matthias Wessendorf <ma...@apache.org>.
tomcat 6 is jsp 2.1
and servlet 2.5

myfaces 1.2 will be done q1 2007

On 11/16/06, behrangsa <be...@gmail.com> wrote:
>
> Hi Martin,
>
> Thanks for the explanation. I think I'll switch to Facelets and then
> completely to JSF 1.2 and Facelets on Glassfish (I think it should be
> impossible/difficult to get JSF 1.2 working in Tomcat as it requires a JSP
> 2.5 compliant container). Also is MyFaces, JSF 1.2 compliant?
>
> BTW - Wouldn't it work if there was a MyFaces init param that we could set
> so that the component hierarchy and the ids assigned to them were
> recalculated on every request? Not efficient, but a life saver for
> development time...
>
> Regards,
> Behi
>
>
> Martin Marinschek wrote:
> >
> > Hi Behi,
> >
> > the first issue you are seeing is due to the fact that if you change
> > the JSP-page-hierarchy, JSF doesn't know anymore which id it should
> > assign to which component. This problem can be fixed by either
> > switching to facelets or JSF1.2 (in 1.2, the container provides the
> > id's per tag, I hope that with this direct link there will be no
> > problem in adding another tag - haven't tried it yet, though).
> >
> > For the second issue, are you using direct value="myvalue" attributes
> > or value-binding as in value="#{test.myValue}"?
> >
> > Properties are not reloaded on every request, if they are set as a
> > hard-coded string. Look at the following code-snippet to see how the
> > component is created on a new page and reused on an existing page:
> >
> >             _componentInstance = findComponent(parent,id);
> >             if (_componentInstance == null)
> >             {
> >                 _componentInstance = createComponentInstance(context, id);
> >                 setProperties(_componentInstance);
> >                 int index = getAddedChildrenCount(parentTag);
> >                 List children = parent.getChildren();
> >                 if (index <= children.size())
> >                 {
> >                     children.add(index, _componentInstance);
> >                 }
> >                 else
> >                 {
> >                     throw new FacesException("cannot add component");
> >                 }
> >             }
> >
> >
> > regards,
> >
> > Martin
> >
> > On 11/16/06, behrangsa <be...@gmail.com> wrote:
> >>
> >> Hi,
> >>
> >> When I modify a JSP (add/remove some children to a panelGrid,etc.) and
> >> press
> >> F5 to see the changes, I get the following exception in Tomcat 5.5.17 or
> >> 5.5.20:
> >>
> >> javax.faces.FacesException: Client-id : _idJsp0 is duplicated in the
> >> faces
> >> tree. Component : _idJsp0, path: {Component-Path : [Class:
> >> javax.faces.component.UIViewRoot,ViewId: /position/index.jsp][Class:
> >> javax.faces.component.html.HtmlPanelGrid,Id: positionPane][Class:
> >> javax.faces.component.html.HtmlPanelGrid,Id: ositionTitlePane][Class:
> >> javax.faces.component.html.HtmlOutputText,Id: _idJsp0]}
> >>
> >> org.apache.myfaces.context.servlet.ServletExternalContextImpl.dispatch(ServletExternalContextImpl.java:422)
> >>
> >> org.apache.myfaces.application.jsp.JspViewHandlerImpl.renderView(JspViewHandlerImpl.java:234)
> >>
> >> org.apache.myfaces.lifecycle.LifecycleImpl.render(LifecycleImpl.java:384)
> >>         javax.faces.webapp.FacesServlet.service(FacesServlet.java:138)
> >>
> >> The second time I press F5, everything starts working fine again. Any
> >> ideas
> >> how can I overcome this problem?
> >>
> >> Also, sometimes when I change the value attribute of an outputText and
> >> press
> >> F5 to see the changes, the changes are not reflected... any ideas what
> >> should I do to make these glitches go away?
> >>
> >> Regards,
> >> Behi
> >> --
> >> View this message in context:
> >> http://www.nabble.com/javax.servlet.ServletException%3A-Client-id-%3A-_idJsp0-is-duplicated-in-the-faces-tree.-tf2640305.html#a7370404
> >> Sent from the MyFaces - Users mailing list archive at Nabble.com.
> >>
> >>
> >
> >
> > --
> >
> > http://www.irian.at
> >
> > Your JSF powerhouse -
> > JSF Consulting, Development and
> > Courses in English and German
> >
> > Professional Support for Apache MyFaces
> >
> >
>
> --
> View this message in context: http://www.nabble.com/javax.servlet.ServletException%3A-Client-id-%3A-_idJsp0-is-duplicated-in-the-faces-tree.-tf2640305.html#a7377326
> Sent from the MyFaces - Users mailing list archive at Nabble.com.
>
>


-- 
Matthias Wessendorf
http://tinyurl.com/fmywh

further stuff:
blog: http://jroller.com/page/mwessendorf
mail: mwessendorf-at-gmail-dot-com

Re: javax.servlet.ServletException: Client-id : _idJsp0 is duplicated in the faces tree.

Posted by behrangsa <be...@gmail.com>.
Hi Martin,

Thanks for the explanation. I think I'll switch to Facelets and then
completely to JSF 1.2 and Facelets on Glassfish (I think it should be
impossible/difficult to get JSF 1.2 working in Tomcat as it requires a JSP
2.5 compliant container). Also is MyFaces, JSF 1.2 compliant?

BTW - Wouldn't it work if there was a MyFaces init param that we could set
so that the component hierarchy and the ids assigned to them were
recalculated on every request? Not efficient, but a life saver for
development time...

Regards,
Behi


Martin Marinschek wrote:
> 
> Hi Behi,
> 
> the first issue you are seeing is due to the fact that if you change
> the JSP-page-hierarchy, JSF doesn't know anymore which id it should
> assign to which component. This problem can be fixed by either
> switching to facelets or JSF1.2 (in 1.2, the container provides the
> id's per tag, I hope that with this direct link there will be no
> problem in adding another tag - haven't tried it yet, though).
> 
> For the second issue, are you using direct value="myvalue" attributes
> or value-binding as in value="#{test.myValue}"?
> 
> Properties are not reloaded on every request, if they are set as a
> hard-coded string. Look at the following code-snippet to see how the
> component is created on a new page and reused on an existing page:
> 
>             _componentInstance = findComponent(parent,id);
>             if (_componentInstance == null)
>             {
>                 _componentInstance = createComponentInstance(context, id);
>                 setProperties(_componentInstance);
>                 int index = getAddedChildrenCount(parentTag);
>                 List children = parent.getChildren();
>                 if (index <= children.size())
>                 {
>                     children.add(index, _componentInstance);
>                 }
>                 else
>                 {
>                     throw new FacesException("cannot add component");
>                 }
>             }
> 
> 
> regards,
> 
> Martin
> 
> On 11/16/06, behrangsa <be...@gmail.com> wrote:
>>
>> Hi,
>>
>> When I modify a JSP (add/remove some children to a panelGrid,etc.) and
>> press
>> F5 to see the changes, I get the following exception in Tomcat 5.5.17 or
>> 5.5.20:
>>
>> javax.faces.FacesException: Client-id : _idJsp0 is duplicated in the
>> faces
>> tree. Component : _idJsp0, path: {Component-Path : [Class:
>> javax.faces.component.UIViewRoot,ViewId: /position/index.jsp][Class:
>> javax.faces.component.html.HtmlPanelGrid,Id: positionPane][Class:
>> javax.faces.component.html.HtmlPanelGrid,Id: ositionTitlePane][Class:
>> javax.faces.component.html.HtmlOutputText,Id: _idJsp0]}
>>
>> org.apache.myfaces.context.servlet.ServletExternalContextImpl.dispatch(ServletExternalContextImpl.java:422)
>>
>> org.apache.myfaces.application.jsp.JspViewHandlerImpl.renderView(JspViewHandlerImpl.java:234)
>>        
>> org.apache.myfaces.lifecycle.LifecycleImpl.render(LifecycleImpl.java:384)
>>         javax.faces.webapp.FacesServlet.service(FacesServlet.java:138)
>>
>> The second time I press F5, everything starts working fine again. Any
>> ideas
>> how can I overcome this problem?
>>
>> Also, sometimes when I change the value attribute of an outputText and
>> press
>> F5 to see the changes, the changes are not reflected... any ideas what
>> should I do to make these glitches go away?
>>
>> Regards,
>> Behi
>> --
>> View this message in context:
>> http://www.nabble.com/javax.servlet.ServletException%3A-Client-id-%3A-_idJsp0-is-duplicated-in-the-faces-tree.-tf2640305.html#a7370404
>> Sent from the MyFaces - Users mailing list archive at Nabble.com.
>>
>>
> 
> 
> -- 
> 
> http://www.irian.at
> 
> Your JSF powerhouse -
> JSF Consulting, Development and
> Courses in English and German
> 
> Professional Support for Apache MyFaces
> 
> 

-- 
View this message in context: http://www.nabble.com/javax.servlet.ServletException%3A-Client-id-%3A-_idJsp0-is-duplicated-in-the-faces-tree.-tf2640305.html#a7377326
Sent from the MyFaces - Users mailing list archive at Nabble.com.


Re: javax.servlet.ServletException: Client-id : _idJsp0 is duplicated in the faces tree.

Posted by Martin Marinschek <ma...@gmail.com>.
Hi Behi,

the first issue you are seeing is due to the fact that if you change
the JSP-page-hierarchy, JSF doesn't know anymore which id it should
assign to which component. This problem can be fixed by either
switching to facelets or JSF1.2 (in 1.2, the container provides the
id's per tag, I hope that with this direct link there will be no
problem in adding another tag - haven't tried it yet, though).

For the second issue, are you using direct value="myvalue" attributes
or value-binding as in value="#{test.myValue}"?

Properties are not reloaded on every request, if they are set as a
hard-coded string. Look at the following code-snippet to see how the
component is created on a new page and reused on an existing page:

            _componentInstance = findComponent(parent,id);
            if (_componentInstance == null)
            {
                _componentInstance = createComponentInstance(context, id);
                setProperties(_componentInstance);
                int index = getAddedChildrenCount(parentTag);
                List children = parent.getChildren();
                if (index <= children.size())
                {
                    children.add(index, _componentInstance);
                }
                else
                {
                    throw new FacesException("cannot add component");
                }
            }


regards,

Martin

On 11/16/06, behrangsa <be...@gmail.com> wrote:
>
> Hi,
>
> When I modify a JSP (add/remove some children to a panelGrid,etc.) and press
> F5 to see the changes, I get the following exception in Tomcat 5.5.17 or
> 5.5.20:
>
> javax.faces.FacesException: Client-id : _idJsp0 is duplicated in the faces
> tree. Component : _idJsp0, path: {Component-Path : [Class:
> javax.faces.component.UIViewRoot,ViewId: /position/index.jsp][Class:
> javax.faces.component.html.HtmlPanelGrid,Id: positionPane][Class:
> javax.faces.component.html.HtmlPanelGrid,Id: ositionTitlePane][Class:
> javax.faces.component.html.HtmlOutputText,Id: _idJsp0]}
>
> org.apache.myfaces.context.servlet.ServletExternalContextImpl.dispatch(ServletExternalContextImpl.java:422)
>
> org.apache.myfaces.application.jsp.JspViewHandlerImpl.renderView(JspViewHandlerImpl.java:234)
>         org.apache.myfaces.lifecycle.LifecycleImpl.render(LifecycleImpl.java:384)
>         javax.faces.webapp.FacesServlet.service(FacesServlet.java:138)
>
> The second time I press F5, everything starts working fine again. Any ideas
> how can I overcome this problem?
>
> Also, sometimes when I change the value attribute of an outputText and press
> F5 to see the changes, the changes are not reflected... any ideas what
> should I do to make these glitches go away?
>
> Regards,
> Behi
> --
> View this message in context: http://www.nabble.com/javax.servlet.ServletException%3A-Client-id-%3A-_idJsp0-is-duplicated-in-the-faces-tree.-tf2640305.html#a7370404
> Sent from the MyFaces - Users mailing list archive at Nabble.com.
>
>


-- 

http://www.irian.at

Your JSF powerhouse -
JSF Consulting, Development and
Courses in English and German

Professional Support for Apache MyFaces