Skip to content

Instantly share code, notes, and snippets.

@sednem
Created October 18, 2013 16:44
Show Gist options
  • Save sednem/7044296 to your computer and use it in GitHub Desktop.
Save sednem/7044296 to your computer and use it in GitHub Desktop.
Cadastrar Usuario
<!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>
</h:head>
<body>
<h:form id="formUsuario" prependId="false">
<h:graphicImage id="img" library="default" value="img/livro.png" />
<h:panelGrid columns="3">
<h:outputLabel for="usuario" value="#{msg.usuario}:" />
<h:inputText id="usuario" value="#{usuarioBean.usuario.login}" />
<h:message for="usuario" />
<h:outputLabel for="senha" value="#{msg.senha}:" />
<h:inputSecret id="senha" value="#{usuarioBean.usuario.senha}" />
<h:message for="senha" />
<h:outputLabel for="confSenha" value="#{msg['conf.senha']}:" />
<h:inputSecret id="confSenha" value="#{usuarioBean.confSenha}" />
<h:message for="confSenha" />
<h:outputLabel for="nome" value="#{msg.nome}:" />
<h:inputText id="nome" value="#{usuarioBean.usuario.nome}" />
<h:message for="nome" />
<h:outputLabel for="email" value="#{msg.email}:" />
<h:inputText id="email" value="#{usuarioBean.usuario.email}">
<f:validateRegex for="email"
pattern="#{msg['email.regex']}" />
</h:inputText>
<h:message for="email" />
<h:outputLabel for="sexo" value="#{msg.sexo}:" />
<h:selectOneRadio id="sexo" value="#{usuarioBean.usuario.sexo}">
<f:selectItem itemLabel="#{msg['sexo.masculino']}"
itemValue="#{msg['sexo.masculino']}" />
<f:selectItem itemLabel="#{msg['sexo.feminino']}"
itemValue="#{msg['sexo.feminino']}" />
</h:selectOneRadio>
<h:message for="sexo" />
<h:outputLabel for="dt_nasc" value="#{msg['data.nascimento']}:" />
<h:inputText id="dt_nasc"
value="#{usuarioBean.usuario.dataNascimento}">
<f:convertDateTime pattern="#{msg['data.pattern']}" />
</h:inputText>
<h:message for="dt_nasc" />
<h:commandButton action="#{usuarioBean.cadastrar}" value="#{msg['cadastrar.usuario']}">
<f:ajax execute="@form" render="@all" />
</h:commandButton>
</h:panelGrid>
<h:messages id="msgs" globalOnly="true"/>
</h:form>
</body>
</html>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment