Just though I would expand on the issue a little bit with some code samples.
I have written a test xhtml page to help demonstrate the problem. Here is the source for that page:
[i]<!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"
xmlns:ui="
http://java.sun.com/jsf/facelets"
xmlns:h="
http://java.sun.com/jsf/html">
<body>
Hello There.
<form jsfc="h:form">
<input jsfc="h:commandButton" type="submit" id="continue" value="continue" action="continue"/>
</form>
</body>
</html>[/i]
This renders fine in tomcat and shows the text, 'Hello There', follwed by an input button.
The output when I access the page using glassfish looks garbled. The source of the page, when rendered in glassfish, is as follows:
[i]<!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��
�body�
Hello There.�form�id="j_id2��name="j_id2��method="post��action="/springtest-web/index.jsf��enctype="application/x-www-form-urlencoded���input�id="j_id2:continue��name="j_id2:continue��type="submit��value="continue��onclick="if(typeof window.clearFormHiddenParams_j_id2!='undefined'){clearFormHiddenParams_j_id2('j_id2');}� />�input�type="hidden��name="j_id2_SUBMIT��value="1� />�input�type="hidden��name="j_id2:_idcl� />�input�type="hidden��name="j_id2:_link_hidden_� />�script�type="text/javascript��<!--
function clear_j_5Fid2()
{
clearFormHiddenParams_j_id2('j_id2');
}
function clearFormHiddenParams_j_id2(currFormName)
{
var f = document.forms['j_id2'];
f.elements['j_id2:_idcl'].value='';
f.elements['j_id2:_link_hidden_'].value='';
f.target='';
}
clearFormHiddenParams_j_id2();
//--></script�<input type="hidden" name="javax.faces.ViewState" id="javax.faces.ViewState" value="rO0ABXVyABNbTGphdmEubGFuZy5PYmplY3Q7kM5YnxBzKWwCAAB4cAAAAAN0AAExcHQADC9pbmRleC54aHRtbA==" /></form>
</body>
</html>[/i]
The jsf inserted javascript functions have come out fine but the code I had in my test page has come out looking quite incorrect.
Does anybody have a clue why this might have happened?
[Message sent by forum member 'peterslater' (peterslater)]
http://forums.java.net/jive/thread.jspa?messageID=211481