In my jsf page code I have a structure similiar to this one :
<frameset id="navframeset">
<frame name="navframe" src='<c:url value="TopNavigation.jsf"/>'/>
<frameset>
<frame name="leftframe" src='<c:url value="Test1.jsf"/>'/>
<frame name="tabbedframe" src='<c:url value="Test2.jsf"/>' />
</frameset>
In Test2.jsf i included following richfaces libraries :
<%@ taglib uri="http://richfaces.org/a4j" prefix="a4j"%>
<%@ taglib uri="http://richfaces.org/rich" prefix="rich"%>
When I try to use any of a4j element in a page code, for instance a4j:button, then this code is generated in my output html file :
<head>...</head>
<body>..</body>
<head><script xmlns="http://www.w3.org/1999/xhtml">A4J.AJAX._scriptEvaluated=true;</script></head>
<body marginwidth="0" marginheight="0"></body>
These two last lines are added when I use a4j element in my page code and it duplicate existing body and html tags(first two lines). Version of richfaces which I'm using is 3.1.6.SR1. Can anybody give me a hint how to fix it ?
Ok, this is an issue of 3.1.6.SR1 library, the last one which support jsf 1.1 version. I have found in google following solution https://developer.jboss.org/thread/196997?tstart=0. However it's not perfect and doesn't work in every situation. Because of this i was trying to solve this issue in other ways and as suggestion in above link I've changed AJAX.js file form richfaces-impl.jar. I took AJAX.js file from richfaces-3.2 version and replace code in 3.1.6.SR1. Following parts should be changed :
line 1412 // Added A4J.AJAX.TestScriptEvaluation();
line 2014 TestScriptEvaluation function should be replaced to the following one:
And that's all. With this changes this issue is not exists anymore.