M
markspace
Hi all, I've got a weird problem with JSF rendering. For some reason,
the label attribute doesn't want to render on the resulting HTML output.
For example, if I have this:
<h:inputText label="First Name"
id="fname"
required="true" />
That label, "First Name", never shows up on the HTML. I checked the
HTML source too and it's not there, so it's not a browser problem per se.
There's some other oddities that are convincing me maybe it's a
configuration parameter somewhere, or maybe the JSF library I'm using.
I have Glassfish with the Oracle libraries, i.e. what came with NetBeans
6.9.1. However I haven't been able to locate any configuration
information for Oracles JSF implementation, or even for any JSF
implementation.
Any help getting that label to display would be much appreciated.
Here's the full JSF Xhtml test file I made to duplicate the error.
<?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://java.sun.com/jsf/html"
xmlns:f="http://java.sun.com/jsf/core">
<h:head>
<title>A Simple JSF App</title>
</h:head>
<h:body>
<h:form>
<h2>JSF Registration APP</h2>
<h4>Registration Form</h4>
<table>
<tr>
<td>
<h:inputText label="First Name"
id="fname"
required="true" />
<h:message for="fname" />
</td>
</tr>
</table>
<p><h:messages /></p>
<p><h:commandButton value="Click Me" action="confirm" /></p>
</h:form>
</h:body>
</html>
the label attribute doesn't want to render on the resulting HTML output.
For example, if I have this:
<h:inputText label="First Name"
id="fname"
required="true" />
That label, "First Name", never shows up on the HTML. I checked the
HTML source too and it's not there, so it's not a browser problem per se.
There's some other oddities that are convincing me maybe it's a
configuration parameter somewhere, or maybe the JSF library I'm using.
I have Glassfish with the Oracle libraries, i.e. what came with NetBeans
6.9.1. However I haven't been able to locate any configuration
information for Oracles JSF implementation, or even for any JSF
implementation.
Any help getting that label to display would be much appreciated.
Here's the full JSF Xhtml test file I made to duplicate the error.
<?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://java.sun.com/jsf/html"
xmlns:f="http://java.sun.com/jsf/core">
<h:head>
<title>A Simple JSF App</title>
</h:head>
<h:body>
<h:form>
<h2>JSF Registration APP</h2>
<h4>Registration Form</h4>
<table>
<tr>
<td>
<h:inputText label="First Name"
id="fname"
required="true" />
<h:message for="fname" />
</td>
</tr>
</table>
<p><h:messages /></p>
<p><h:commandButton value="Click Me" action="confirm" /></p>
</h:form>
</h:body>
</html>