I have a Facelet file with JSF tags to display a label, an input field and a button, but those parts are are not visible in the browser when I run it.
<?xml version="1.0" encoding="UTF-8"?>
<!--
To change this template, choose Tools | Templates
and open the template in the editor.
-->
<!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://java.sun.com/jsf/html">
<h:head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8"/>
<title> supply a title</title>
</h:head>
<h:body>
<h:form>
Name:
<h:outputLabel value="First Name:"> </h:outputLabel>
<h:inputText id="name" value="#{DataForm.name}"></h:inputText>
<h:commandButton value="Doctor Register" action="#{DataForm.submit}"> </h:commandButton>
</h:form>
</h:body>
</html>
How is this caused and how can I solve it? I am using netbeans 6.9.1 Glassfish 3.1.
This can happen when the
FacesServletis not been invoked. It’s the one responsible for parsing the Facelet file and doing all the JSF works.You need to ensure that your request URL (the one which you see in the browser address bar) matches the URL pattern of the
FacesServletas it is been mapped in theweb.xml. If it’s for example mapped on an URL pattern of*.jsf, then you need to ensure that you open the page in browser byOr when you want to invoke the
FacesServleton every*.xhtmlrequest, then you need to change the URL pattern of the mapping inweb.xmlaccordingly (recommended)