I am trying to learn the basic of Java Server Faces (JSF) and currently I am facing problem that the entered content in the input field in the hello-world.xhtml
is not being rendered in the myresponse.xhtml file. Does someone see the error for this behaviour?
hello-world.xhtml
<!DOCTYPE html>
<html lang="en"
xmlns="http://www.w3.org/1999/xhtml"
xmlns:h="http://xmlns.jcp.org/jsf/html"
xmlns:a="http://xmlns.jcp.org/jsf/passthrough">
<h:head>
<title>Hello World - Input Form</title>
</h:head>
<h:body>
<h:form>
<h:inputText id="name" value="#{theUserName}"
a:placeholder="What's your name?" />
<h:commandButton value="Submit" action="myresponse" />
</h:form>
</h:body>
</html>
myresponse.xhtml
<!DOCTYPE html>
<html lang="en"
xmlns="http://www.w3.org/1999/xhtml"
xmlns:h="http://xmlns.jcp.org/jsf/html">
<h:head>
<title>Hello World - Response</title>
</h:head>
<h:body>
Hello, #{theUserName}
</h:body>
</html>
screen shoot
Edit:
So I tried it in the Version: Mars.2 Release (4.5.2)
with Tomacat 7 and Java 8 and it did not work but when I tried it with Version: Kepler Service Release 2
with Tomcat 7 and Java 8, it worked.
C:\Windows\System32>java -version
java version "1.8.0_74"
Java(TM) SE Runtime Environment (build 1.8.0_74-b02)
Is there any explaniation for that?