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 <[EMAIL PROTECTED]> 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 <[EMAIL PROTECTED]> 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.
>
>

Reply via email to