I just got a trivial example running, and everything seems to work except the PRETTY_HTML context parameter which seems to have no effect.
My simple page is written using jsp xml (a.k.a. jspx) syntax and is shown at the bottom of this e-mail.
When the page is sent to the client all the markup ends up on a single line followed by the script statements (as you can see below).

I have specified the following context parameter in web.xml:
    <context-param>
        <param-name>org.apache.myfaces.PRETTY_HTML</param-name>
        <param-value>true</param-value>
    </context-param>

I checked that the web.xml is valid (using an XML validator), and based on my investigations the other context parameters seem to work.
I am using the latest version (downloaded yesterday) on JBoss 4.
Should anyone have a clue to what could be wrong, I would be grateful.

Yours
Randahl





MY RESULT OUTPUT:
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" lang="en" xml:lang="en"><head><title>Test Page</title></head><body><h2>Test</h2><p>Paragraph</p><form id="responseForm" name="responseForm" method="post" action="/puls/rendering/master.jsf" enctype="application/x-www-form-urlencoded"><input id="responseForm:back" name="responseForm:back" type="submit" value="Back" onclick="clear_responseForm();document.forms['responseForm'].elements['autoScroll'].value=getScrolling();"/><input type="hidden" name="responseForm_SUBMIT" value="1"/><input type="hidden" name="autoScroll"/><input type="hidden" name="responseForm:_link_hidden_"/><script type="text/_javascript_">
<!--
function clear_responseForm() {
  var f = document.forms['responseForm'];
  f.elements['responseForm:_link_hidden_'].value=null;
  f.target='';
}
clear_responseForm();
//-->
</script></form></body></html>
<script type="text/_javascript_">
<!--
function getScrolling() {
    var x = 0; var y = 0;
    if (document.body && document.body.scrollLeft && !isNaN(document.body.scrollLeft)) {
        x = document.body.scrollLeft;
    } else if (window.pageXOffset && !isNaN(window.pageXOffset)) {
        x = window.pageXOffset;
    }
    if (document.body && document.body.scrollTop && !isNaN(document.body.scrollTop)) {
        y = document.body.scrollTop;
    } else if (window.pageYOffset && !isNaN(window.pageYOffset)) {
        y = window.pageYOffset;
    }
    return x + "," + y;
}
window.scrollTo(0,0);
//-->
</script>


MY ORIGINAL PAGE:

<?xml version="1.0" encoding="UTF-8"?>
<jsp:root
    xmlns="http://www.w3.org/1999/xhtml"
    xmlns:h="http://java.sun.com/jsf/html"
    xmlns:f="http://java.sun.com/jsf/core"
    xmlns:jsp="http://java.sun.com/JSP/Page"
    version="2.0"
>
    <jsp:output
        doctype-root-element="html"
        doctype-public="-//W3C//DTD XHTML 1.0 Strict//EN"
        doctype-system="http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"
    />
     <jsp:directive.page contentType="text/html;charset=UTF-8"/>
    <f:view>
        <html xmlns="http://www.w3.org/1999/xhtml"" xml:lang="en" lang="en">
            <head>
                <title>Test Page</title>
            </head>
            <body>
                <h2>Test</h2>
                <p>Paragraph</p>
                <h:form id="responseForm">
                    <h:commandButton id="back" value="Back" action=""/>
                </h:form>
            </body>
        </html>
    </f:view>
</jsp:root>





Reply via email to