I have a problem with loading Facelets pages from Javascript. I'm working with Netbeans 7.2, Glassfish 3.1.2 and Java EE 6.
I made a simple test page:
<html xmlns="http://www.w3.org/1999/xhtml"
xmlns:h="http://java.sun.com/jsf/html">
<h:head>
<script type="text/javascript">
window.location.href = "index.xhtml";
</script>
<title>winq match!</title>
</h:head>
<h:body>
<h1>WING MATCH!!</h1>
<h:form>
<h:commandButton id="Next" value="weiter" action="index"/>
</h:form>
</h:body>
The index.xhtml
page that should be loaded with window.location.href
is:
<html xmlns="http://www.w3.org/1999/xhtml"
xmlns:h="http://java.sun.com/jsf/html"
xmlns:f="http://java.sun.com/jsf/core">
<h:head>
<title>Facelet Title</title>
</h:head>
<h:body>
<h:form>
<h:outputText value="TestTestTestTestTest"/>
msg <h:inputText id="ema" value="#{testBean.inputValue}" maxlength="1" />
<h:commandButton id="but" value="Submit" action="index"/>
</h:form>
</h:body>
The page is loaded but not parsed and thus the h:
tags are not interpreted by the browser. After searching the web on this it seems that I'm the only one with a problem like this. Maybe I´ve misunderstood some aspects of JSF. I hope to get some advise on this.