jsf-spring-integration - minor refactors

This commit is contained in:
Slavisa Baeldung
2016-05-26 14:29:19 +02:00
parent c76666a9b3
commit 193adf82bc
3 changed files with 27 additions and 38 deletions
+2 -6
View File
@@ -9,12 +9,8 @@
<param-value>SERVER</param-value>
</context-param>
<context-param>
<param-name>
primefaces.PUBLIC_CAPTCHA_KEY
</param-name>
<param-value>
6LdG-84SAAAAALQfp6DuJqd1XLnz3ZlHfhunPPjY
</param-value>
<param-name>javax.faces.FACELETS_SKIP_COMMENTS</param-name>
<param-value>true</param-value>
</context-param>
<servlet>
<servlet-name>Faces Servlet</servlet-name>
+17 -14
View File
@@ -2,24 +2,27 @@
<!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">
xmlns:h="http://java.sun.com/jsf/html">
<h:head>
<title><h:outputText value="#{msg['message.welcome']}"/></title>
</h:head>
<h:body>
<h:form>
<f:ajax render="theGrid">
<h:panelGrid id="theGrid" columns="3">
<h:outputText value="Username"/>
<h:inputText id="firstName" required="true" requiredMessage="#{msg['message.valueRequired']}"
value="#{registration.userName}"/>
<h:message for="firstName"/>
<h:commandButton value="#{msg['label.saveButton']}" action="#{registration.createNewUser}"/>
<h:outputText value="#{registration.operationMessage}"/>
</h:panelGrid>
</f:ajax>
</h:form>
<h:form>
<h:panelGrid id="theGrid" columns="3">
<h:outputText value="Username"/>
<h:inputText id="firstName" binding="#{userName}" required="true" requiredMessage="#{msg['message.valueRequired']}"
value="#{registration.userName}"/>
<h:message for="firstName" style="color:red;"/>
<h:commandButton value="#{msg['label.saveButton']}" action="#{registration.createNewUser}"
process="@this"/>
<!--
Accessing the Spring bean directly from the page
<h:commandButton value="Save"
action="#{registration.userDao.createUser(userName.value)}"/>
-->
<h:outputText value="#{registration.operationMessage}" style="color:green;"/>
</h:panelGrid>
</h:form>
</h:body>
</html>