I have written the following, very simple JSF page:
<?xml version='1.0' encoding='UTF-8' ?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml"
xmlns:h="http://xmlns.jcp.org/jsf/html"
xmlns:f="http://xmlns.jcp.org/jsf/core">
<f:metadata>
<f:viewParam name="name" value="#{nameController.name}" />
</f:metadata>
<h:head>
<title>Hello, <h:outputText value="#{nameController.name}" /></title>
</h:head>
<h:body>
Hello, <h:outputText value="#{nameController.name}" />
</h:body>
</html>
The name
property of nameController
is just an instance variable with a getter and a setter.
However, when I go to the page http://localhost:8080/NameThing/name.xhtml?name=tbodt
(and that is the correct path to the page) I get this result:
<?xml version='1.0' encoding='UTF-8' ?>
<!DOCTYPE html>
<html xmlns="http://www.w3.org/1999/xhtml"><head id="j_idt3">
<title>Hello, </title></head><body>
Hello, </body>
</html>
What am I doing wrong?