myfaces-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Michael Moossen (JIRA)" <...@myfaces.apache.org>
Subject [jira] [Comment Edited] (MYFACES-3631) Malformed Ajax XML Response with duplicated IDs
Date Mon, 22 Oct 2012 06:46:12 GMT

    [ https://issues.apache.org/jira/browse/MYFACES-3631?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13480220#comment-13480220
] 

Michael Moossen edited comment on MYFACES-3631 at 10/22/12 6:44 AM:
--------------------------------------------------------------------

not sure you understood correctly the issue.
there is an ajax request to the server, the server detects that there is a problem with the
response, in this case that the reponse would generate an invalid html page with duplicated
IDs and sends an error message back.
until now everything is fine. the point is that the client can not correctly handle the error
message because the ajax response with the error message is not well formed:
<?xml version="1.0" encoding="utf-8"?>
<partial-response>
  <error>
    <error-name>java.lang.IllegalStateException</error-name>
    <error-message><![CDATA[component with duplicate id "form:myId" found]]></error-message>
  </error>
  </changes>  <======= HERE
</partial-response>
                
      was (Author: mmoossen):
    not sure you understood correctly the issue.
the ajax response with the error message is not well formed:
<?xml version="1.0" encoding="utf-8"?>
<partial-response>
  <error>
    <error-name>java.lang.IllegalStateException</error-name>
    <error-message><![CDATA[component with duplicate id "form:myId" found]]></error-message>
  </error>
  </changes>  <======= HERE
</partial-response>
                  
> Malformed Ajax XML Response with duplicated IDs
> -----------------------------------------------
>
>                 Key: MYFACES-3631
>                 URL: https://issues.apache.org/jira/browse/MYFACES-3631
>             Project: MyFaces Core
>          Issue Type: Bug
>          Components: General
>    Affects Versions: 2.0.9, 2.0.15
>            Reporter: Michael Moossen
>            Assignee: Leonardo Uribe
>            Priority: Minor
>
> code to reproduce:
> {code:xml}
> <?xml version="1.0" encoding="UTF-8"?>
> <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
>         "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
> <html xmlns="http://www.w3.org/1999/xhtml"
>       xmlns:h="http://java.sun.com/jsf/html"
>       xmlns:a4j="http://richfaces.org/a4j"
>       xmlns:c="http://java.sun.com/jsp/jstl/core"
>       xmlns:rich="http://richfaces.org/rich" >
>   <h:head><title>Test</title></h:head>
>   <h:body>
>     <h1>Test</h1>
>     <h:form id="form" >
>       <rich:tabPanel switchType="ajax" >
>         <rich:tab name="tab1" header="tab1">
>           Tab1
>           <h:selectBooleanCheckbox value="#{testBean.check}" />
>         </rich:tab>
>         <rich:tab name="tab2" header="tab2">
>           <c:if test="#{testBean.check}">
>             <h:inputText id="myId" />
>             <h:inputText id="myId" />
>           </c:if>
>         </rich:tab>
>       </rich:tabPanel>
>     </h:form>
>     <a4j:log />
>   </h:body>    
> </html>
> {code}
> check the checkbox and change the tab to obtain:
> {code}
> info [16:20:14.159]: Received 'begin' event from <div id=form:j_id2114509110_7e08d99f
class=rf-tab ...>
> info [16:20:14.213]: Received 'beforedomupdate' event from <div id=form:j_id2114509110_7e08d99f
class=rf-tab ...>
> info [16:20:14.215]: Server returned responseText: <?xml version="1.0" encoding="utf-8"?><partial-response><error><error-name>java.lang.IllegalStateException</error-name><error-message><![CDATA[component
with duplicate id "form:myId" found]]></error-message></error></changes></partial-response>
> error[16:20:14.218]: Received 'error@malformedXML' event from <div id=form:j_id2114509110_7e08d99f
class=rf-tab ...>
> error[16:20:14.218]: [200] undefined: undefined
> info [16:20:14.220]: Received 'complete' event from <div id=form:j_id2114509110_7e08d99f
class=rf-tab ...>
> {code}
> I think the problem is somewhere in the org.apache.myfaces.shared.context.AjaxExceptionHandlerImpl
class but not sure.

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira

Mime
View raw message