Create a gist now

Instantly share code, notes, and snippets.

if (len <= 0) {
FacesContext.getCurrentInstance().addMessage(null, new FacesMessage("You must enter a temperature"));
<div id="container">
<h:form id="convertForm">
<h:panelGrid columns="4">
<h:outputLabel for="tempFrom">Temperature:</h:outputLabel>
<h:inputText value="#{tempFrom}" id="tempFrom" />
<h:message for="tempFrom" errorClass="invalid" />
<h:commandButton id="add" value="Convert"
<h:form id="response">
<h:panelGrid columns="2">
<h:outputLabel>Converts to:</h:outputLabel>
<h:outputLabel value="#{tempConvert.temperature}" />
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment