You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@myfaces.apache.org by Tobias Freier <tr...@beople.de> on 2007/09/19 01:57:42 UTC

Re: [TRINIDAD] PPR problem with 1.2.2 branch


Leonardo Uribe wrote:
> 
> ["Invalid PPR response. The response-headers were:\nServer:
> Apache-Coyote/1.1\nContent-Type: text/xml;ch..."]
> 
I'm facing a similar error on my page.
Tomcat 6.0.13 with Java 6 upd 2 and the newest version 1.2.2 of trinidad and
RI jsf 1.2.4.

trimmed jsf code:
<html xmlns="http://www.w3.org/1999/xhtml">
<f:view>
<head>
</head>
<trh:body id="a1">
  <tr:form id="form1">
    <tr:table id="table1" ...>
      <tr:column styleClass="mystyle">
        <h:outputText value="#{table.value}" styleClass="boldText" />
      </tr:column>
    </tr:table>
  </tr:form>
</trh:body>
</f:view>
</html>

So body, form and table have an id.
When I try to change the range of the table or trigger any other event to
update the tabele it doesn't work. The RangeChangeEvent method is executed
but the page doesn't refresh. Instead I get the js error 

"Invalid PPR response. The response-headers were:\nServer:
Apache-Coyote/1.1\nX-Powered-By: JSF/1.2\nContent-Type:
text/xml;charset=utf-8\nContent-Language: de\nTransfer-Encoding:
chunked\nDate: Tue, 18 Sep 2007 23:45:14 GMT\n\n The invalid response
was:\n<?xml version=\"1.0\" encoding=\"UTF-8\"
?>\r\n\r\n\r\n\r\n\r\n\r\n\r\n<!DOCTYPE html PUBLIC \"-//W3C//DTD XHTML 1.0
Transitional//EN\"
\"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd\">\r\n<html
xmlns=\"http://www.w3.org/1999/xhtml\">\r\n<?xml version=\"1.0\"
?>\n<?Tr-XHR-Response-Type ?>\n.......
content to replace...

The same code worked under trinidad 1.2.1
Does anyone has a clue why it doesn't work with 1.2.2?

Tnx, Tobias
-- 
View this message in context: http://www.nabble.com/-TRINIDAD--PPR-problem-with-1.2.2-branch-tf4275649.html#a12768364
Sent from the My Faces - Dev mailing list archive at Nabble.com.


Re: [TRINIDAD] PPR problem with 1.2.2 branch

Posted by Tobias Freier <tr...@beople.de>.
The Wikipedia article says that the XML declaration is optional if I use the
default encoding UTF-8. Otherwise I need the declaration. So we can't use
trinidad with anything else than utf-8 (I use utf-8 anyway).

<tr:document> or <trh:html>/<trh:head>/<trh:body> load the default css which
I don't want.
With

<%@ page language="java" contentType="application/xhtml+xml; charset=UTF-8"
    pageEncoding="UTF-8"%>
<f:view>
<trh:html>
<trh:head>
	<title>...</title>
	<meta http-equiv="Content-Type" content="application/xhtml+xml;
charset=UTF-8" />
</trh:head>
<trh:body>
...
I get

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN"
"http://www.w3.org/TR/html4/loose.dtd">
<html dir="ltr" lang="de">
<head>
<meta name="generator" content="Apache Trinidad"><link rel="stylesheet"
charset="UTF-8" type="text/css"
href="/kingstale/adf/styles/cache/minimal-desktop-903655080-gecko-cmp.css">
<script type="text/javascript">var _AdfWindowOpenError='In Ihrem Browser
wurde ein Blocker für Popup-Fenster ermittelt. Popup Blocker stören die
Ausführung dieser Anwendung. Deaktivieren Sie den Popup Blocker oder lassen
Sie Popups von dieser Site zu.';</script><script type="text/javascript"
src="/kingstale/adf/jsLibs/Common1_2_2.js"></script><script
type="text/javascript">_defaultTZ()</script>
	<title>...</title>
	<meta http-equiv="Content-Type" content="application/xhtml+xml;
charset=UTF-8" />
</head><body onload="_checkLoad()" onunload="_checkUnload(event)">

which is no xhtml. For example the link tag is not closed and the doctype is
wrong. Same with tr:document.

Tobias


Adam Winer wrote:
> 
> Ah, great, now we've got a compact description of the bug. :)
> If you have an XML declaration, in the doc, we end up generating
> two XML declarations on a PPR response.  There's code in Trinidad (in
> the XmlOutput code) to strip anything before an XML declaration,
> but it gets tripped up if there are two.
> 
> My understanding, backed up by:
> http://en.wikipedia.org/wiki/XHTML#XML_Declaration
> is that you don't need the XML declaration to be valid XHTML.
> 
> There is a clear error in your page, though:
> 
> contentType="text/html; charset=UTF-8"
> 
> is wrong.  You need contentType="application/xhtml+xml; charset=UTF-8".
> I'm not surprised your page wasn't rendered as XHTML.
> 
> That said, what you ideally should be doing in Trinidad is using
> <tr:document> or <trh:html>/<trh:head>/<trh:body>, and not
> specifying an XML declaration or DTD, but just letting Trinidad
> do it for you.  These do support generating XHTML DTDs,
> BTW, as long as you've set the contentType correctly.
> 
> -- Adam
> 
> 

-- 
View this message in context: http://www.nabble.com/-TRINIDAD--PPR-problem-with-1.2.2-branch-tf4275649.html#a12799674
Sent from the My Faces - Dev mailing list archive at Nabble.com.


Re: [TRINIDAD] PPR problem with 1.2.2 branch

Posted by Adam Winer <aw...@gmail.com>.
Ah, great, now we've got a compact description of the bug. :)
If you have an XML declaration, in the doc, we end up generating
two XML declarations on a PPR response.  There's code in Trinidad (in
the XmlOutput code) to strip anything before an XML declaration,
but it gets tripped up if there are two.

My understanding, backed up by:
http://en.wikipedia.org/wiki/XHTML#XML_Declaration
is that you don't need the XML declaration to be valid XHTML.

There is a clear error in your page, though:

contentType="text/html; charset=UTF-8"

is wrong.  You need contentType="application/xhtml+xml; charset=UTF-8".
I'm not surprised your page wasn't rendered as XHTML.

That said, what you ideally should be doing in Trinidad is using
<tr:document> or <trh:html>/<trh:head>/<trh:body>, and not
specifying an XML declaration or DTD, but just letting Trinidad
do it for you.  These do support generating XHTML DTDs,
BTW, as long as you've set the contentType correctly.

-- Adam


On 9/19/07, Tobias Freier <tr...@beople.de> wrote:
>
> Thanks for your help Adam,
> It doesn't work on Firefox or IE.
> I don't use Facelets. Just normal JSF with RI 1.2.04P02 and there is no
> MyFaces.
> No this was not the full page (too long). But thanks to your hint with the
> xhtml I found the error.
>
> The page started with:
> <?xml version="1.0" encoding="UTF-8" ?>
> <%@ taglib uri="http://java.sun.com/jsf/html" prefix="h" %>
> <%@ taglib uri="http://java.sun.com/jsf/core" prefix="f" %>
> <%@ taglib uri="http://myfaces.apache.org/trinidad" prefix="tr"%>
> <%@ taglib uri="http://myfaces.apache.org/trinidad/html" prefix="trh"%>
> <%@ page language="java" contentType="text/html; charset=UTF-8"
>     pageEncoding="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">
> <f:view>
> <head>
> ...
>
> therefore the response of the PPR was
>
> <?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">
> <?xml version="1.0" ?>
> <?Tr-XHR-Response-Type ?>
> <content action="..........
>
> Now I deleted the <?xml version="1.0" encoding="UTF-8" ?> at the beginning
> of my JSP page and I get the response
>
> <?xml version="1.0" ?>
> <?Tr-XHR-Response-Type ?>
> <content action="...............
>
> this works fine now.
> The only problem is that this is no longer a well formed xhtml page.
> At this point I saw that my page isn't rendered as xhtml anyway. What do I
> have to use to get xhtml?
>
> Tobias
>
>
>
> Adam Winer wrote:
> >
> > PPR is totally overhauled from 1.2.1 to 1.2.2, so changes
> > aren't a surprise.  The question is why this is happening,
> > and we need more information, because we did (honest)
> > test this code quite a bit, so there's something different about
> > your set up, and ideally you could play around with a lot
> > of variables.
> >
> > First up, are you really only using the RI?  No MyFaces
> > implementation also lying around on the classpath?  I'm
> > guessing this is Firefox?  Is this Facelets?  If so, what
> > version?  If JSP, is that really the full content of your page?
> > Are you using XHTML?  If so, is the problem specific
> > to XHTML (that is, does it go away if you build an
> > HTML page)?
> >
> > -- Adam
> >
> >
> > On 9/18/07, Tobias Freier <tr...@beople.de> wrote:
> >>
> >>
> >> Leonardo Uribe wrote:
> >> >
> >> > ["Invalid PPR response. The response-headers were:\nServer:
> >> > Apache-Coyote/1.1\nContent-Type: text/xml;ch..."]
> >> >
> >> I'm facing a similar error on my page.
> >> Tomcat 6.0.13 with Java 6 upd 2 and the newest version 1.2.2 of trinidad
> >> and
> >> RI jsf 1.2.4.
> >>
> >> trimmed jsf code:
> >> <html xmlns="http://www.w3.org/1999/xhtml">
> >> <f:view>
> >> <head>
> >> </head>
> >> <trh:body id="a1">
> >>   <tr:form id="form1">
> >>     <tr:table id="table1" ...>
> >>       <tr:column styleClass="mystyle">
> >>         <h:outputText value="#{table.value}" styleClass="boldText" />
> >>       </tr:column>
> >>     </tr:table>
> >>   </tr:form>
> >> </trh:body>
> >> </f:view>
> >> </html>
> >>
> >> So body, form and table have an id.
> >> When I try to change the range of the table or trigger any other event to
> >> update the tabele it doesn't work. The RangeChangeEvent method is
> >> executed
> >> but the page doesn't refresh. Instead I get the js error
> >>
> >> "Invalid PPR response. The response-headers were:\nServer:
> >> Apache-Coyote/1.1\nX-Powered-By: JSF/1.2\nContent-Type:
> >> text/xml;charset=utf-8\nContent-Language: de\nTransfer-Encoding:
> >> chunked\nDate: Tue, 18 Sep 2007 23:45:14 GMT\n\n The invalid response
> >> was:\n<?xml version=\"1.0\" encoding=\"UTF-8\"
> >> ?>\r\n\r\n\r\n\r\n\r\n\r\n\r\n<!DOCTYPE html PUBLIC \"-//W3C//DTD XHTML
> >> 1.0
> >> Transitional//EN\"
> >> \"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd\">\r\n<html
> >> xmlns=\"http://www.w3.org/1999/xhtml\">\r\n<?xml version=\"1.0\"
> >> ?>\n<?Tr-XHR-Response-Type ?>\n.......
> >> content to replace...
> >>
> >> The same code worked under trinidad 1.2.1
> >> Does anyone has a clue why it doesn't work with 1.2.2?
> >>
> >> Tnx, Tobias
> >> --
> >> View this message in context:
> >> http://www.nabble.com/-TRINIDAD--PPR-problem-with-1.2.2-branch-tf4275649.html#a12768364
> >> Sent from the My Faces - Dev mailing list archive at Nabble.com.
> >>
> >>
> >
> >
>
> --
> View this message in context: http://www.nabble.com/-TRINIDAD--PPR-problem-with-1.2.2-branch-tf4275649.html#a12775126
> Sent from the My Faces - Dev mailing list archive at Nabble.com.
>
>

Re: [TRINIDAD] PPR problem with 1.2.2 branch

Posted by Tobias Freier <tr...@beople.de>.
Thanks for your help Adam,
It doesn't work on Firefox or IE.
I don't use Facelets. Just normal JSF with RI 1.2.04P02 and there is no
MyFaces.
No this was not the full page (too long). But thanks to your hint with the
xhtml I found the error.

The page started with:
<?xml version="1.0" encoding="UTF-8" ?>
<%@ taglib uri="http://java.sun.com/jsf/html" prefix="h" %>
<%@ taglib uri="http://java.sun.com/jsf/core" prefix="f" %>
<%@ taglib uri="http://myfaces.apache.org/trinidad" prefix="tr"%>
<%@ taglib uri="http://myfaces.apache.org/trinidad/html" prefix="trh"%>
<%@ page language="java" contentType="text/html; charset=UTF-8"
    pageEncoding="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">
<f:view>
<head>
...

therefore the response of the PPR was

<?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">
<?xml version="1.0" ?>
<?Tr-XHR-Response-Type ?>
<content action="..........

Now I deleted the <?xml version="1.0" encoding="UTF-8" ?> at the beginning
of my JSP page and I get the response

<?xml version="1.0" ?>
<?Tr-XHR-Response-Type ?>
<content action="...............

this works fine now.
The only problem is that this is no longer a well formed xhtml page.
At this point I saw that my page isn't rendered as xhtml anyway. What do I
have to use to get xhtml?

Tobias



Adam Winer wrote:
> 
> PPR is totally overhauled from 1.2.1 to 1.2.2, so changes
> aren't a surprise.  The question is why this is happening,
> and we need more information, because we did (honest)
> test this code quite a bit, so there's something different about
> your set up, and ideally you could play around with a lot
> of variables.
> 
> First up, are you really only using the RI?  No MyFaces
> implementation also lying around on the classpath?  I'm
> guessing this is Firefox?  Is this Facelets?  If so, what
> version?  If JSP, is that really the full content of your page?
> Are you using XHTML?  If so, is the problem specific
> to XHTML (that is, does it go away if you build an
> HTML page)?
> 
> -- Adam
> 
> 
> On 9/18/07, Tobias Freier <tr...@beople.de> wrote:
>>
>>
>> Leonardo Uribe wrote:
>> >
>> > ["Invalid PPR response. The response-headers were:\nServer:
>> > Apache-Coyote/1.1\nContent-Type: text/xml;ch..."]
>> >
>> I'm facing a similar error on my page.
>> Tomcat 6.0.13 with Java 6 upd 2 and the newest version 1.2.2 of trinidad
>> and
>> RI jsf 1.2.4.
>>
>> trimmed jsf code:
>> <html xmlns="http://www.w3.org/1999/xhtml">
>> <f:view>
>> <head>
>> </head>
>> <trh:body id="a1">
>>   <tr:form id="form1">
>>     <tr:table id="table1" ...>
>>       <tr:column styleClass="mystyle">
>>         <h:outputText value="#{table.value}" styleClass="boldText" />
>>       </tr:column>
>>     </tr:table>
>>   </tr:form>
>> </trh:body>
>> </f:view>
>> </html>
>>
>> So body, form and table have an id.
>> When I try to change the range of the table or trigger any other event to
>> update the tabele it doesn't work. The RangeChangeEvent method is
>> executed
>> but the page doesn't refresh. Instead I get the js error
>>
>> "Invalid PPR response. The response-headers were:\nServer:
>> Apache-Coyote/1.1\nX-Powered-By: JSF/1.2\nContent-Type:
>> text/xml;charset=utf-8\nContent-Language: de\nTransfer-Encoding:
>> chunked\nDate: Tue, 18 Sep 2007 23:45:14 GMT\n\n The invalid response
>> was:\n<?xml version=\"1.0\" encoding=\"UTF-8\"
>> ?>\r\n\r\n\r\n\r\n\r\n\r\n\r\n<!DOCTYPE html PUBLIC \"-//W3C//DTD XHTML
>> 1.0
>> Transitional//EN\"
>> \"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd\">\r\n<html
>> xmlns=\"http://www.w3.org/1999/xhtml\">\r\n<?xml version=\"1.0\"
>> ?>\n<?Tr-XHR-Response-Type ?>\n.......
>> content to replace...
>>
>> The same code worked under trinidad 1.2.1
>> Does anyone has a clue why it doesn't work with 1.2.2?
>>
>> Tnx, Tobias
>> --
>> View this message in context:
>> http://www.nabble.com/-TRINIDAD--PPR-problem-with-1.2.2-branch-tf4275649.html#a12768364
>> Sent from the My Faces - Dev mailing list archive at Nabble.com.
>>
>>
> 
> 

-- 
View this message in context: http://www.nabble.com/-TRINIDAD--PPR-problem-with-1.2.2-branch-tf4275649.html#a12775126
Sent from the My Faces - Dev mailing list archive at Nabble.com.


Re: [TRINIDAD] PPR problem with 1.2.2 branch

Posted by Adam Winer <aw...@gmail.com>.
PPR is totally overhauled from 1.2.1 to 1.2.2, so changes
aren't a surprise.  The question is why this is happening,
and we need more information, because we did (honest)
test this code quite a bit, so there's something different about
your set up, and ideally you could play around with a lot
of variables.

First up, are you really only using the RI?  No MyFaces
implementation also lying around on the classpath?  I'm
guessing this is Firefox?  Is this Facelets?  If so, what
version?  If JSP, is that really the full content of your page?
Are you using XHTML?  If so, is the problem specific
to XHTML (that is, does it go away if you build an
HTML page)?

-- Adam


On 9/18/07, Tobias Freier <tr...@beople.de> wrote:
>
>
> Leonardo Uribe wrote:
> >
> > ["Invalid PPR response. The response-headers were:\nServer:
> > Apache-Coyote/1.1\nContent-Type: text/xml;ch..."]
> >
> I'm facing a similar error on my page.
> Tomcat 6.0.13 with Java 6 upd 2 and the newest version 1.2.2 of trinidad and
> RI jsf 1.2.4.
>
> trimmed jsf code:
> <html xmlns="http://www.w3.org/1999/xhtml">
> <f:view>
> <head>
> </head>
> <trh:body id="a1">
>   <tr:form id="form1">
>     <tr:table id="table1" ...>
>       <tr:column styleClass="mystyle">
>         <h:outputText value="#{table.value}" styleClass="boldText" />
>       </tr:column>
>     </tr:table>
>   </tr:form>
> </trh:body>
> </f:view>
> </html>
>
> So body, form and table have an id.
> When I try to change the range of the table or trigger any other event to
> update the tabele it doesn't work. The RangeChangeEvent method is executed
> but the page doesn't refresh. Instead I get the js error
>
> "Invalid PPR response. The response-headers were:\nServer:
> Apache-Coyote/1.1\nX-Powered-By: JSF/1.2\nContent-Type:
> text/xml;charset=utf-8\nContent-Language: de\nTransfer-Encoding:
> chunked\nDate: Tue, 18 Sep 2007 23:45:14 GMT\n\n The invalid response
> was:\n<?xml version=\"1.0\" encoding=\"UTF-8\"
> ?>\r\n\r\n\r\n\r\n\r\n\r\n\r\n<!DOCTYPE html PUBLIC \"-//W3C//DTD XHTML 1.0
> Transitional//EN\"
> \"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd\">\r\n<html
> xmlns=\"http://www.w3.org/1999/xhtml\">\r\n<?xml version=\"1.0\"
> ?>\n<?Tr-XHR-Response-Type ?>\n.......
> content to replace...
>
> The same code worked under trinidad 1.2.1
> Does anyone has a clue why it doesn't work with 1.2.2?
>
> Tnx, Tobias
> --
> View this message in context: http://www.nabble.com/-TRINIDAD--PPR-problem-with-1.2.2-branch-tf4275649.html#a12768364
> Sent from the My Faces - Dev mailing list archive at Nabble.com.
>
>