Skip to content

Commit 6e6f7c4

Browse files
jsf-spring-integration - mavenizing
(cherry picked from commit eba201c)
1 parent ef53002 commit 6e6f7c4

File tree

7 files changed

+59
-33
lines changed

7 files changed

+59
-33
lines changed

jsf/pom.xml

Lines changed: 35 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -13,12 +13,39 @@
1313
<version>0.1-SNAPSHOT</version>
1414
<packaging>war</packaging>
1515
<dependencies>
16-
<!-- http://mvnrepository.com/artifact/com.sun.faces/mojarra-jsf-impl -->
1716
<dependency>
1817
<groupId>com.sun.faces</groupId>
19-
<artifactId>mojarra-jsf-impl</artifactId>
20-
<version>2.0.0-b04</version>
18+
<artifactId>jsf-api</artifactId>
19+
<version>${com.sun.faces.version}</version>
2120
</dependency>
21+
<dependency>
22+
<groupId>com.sun.faces</groupId>
23+
<artifactId>jsf-impl</artifactId>
24+
<version>${com.sun.faces.version}</version>
25+
</dependency>
26+
27+
<!-- Spring -->
28+
<dependency>
29+
<groupId>org.springframework</groupId>
30+
<artifactId>spring-web</artifactId>
31+
<version>${org.springframework.version}</version>
32+
</dependency>
33+
<dependency>
34+
<groupId>org.springframework</groupId>
35+
<artifactId>spring-webmvc</artifactId>
36+
<version>${org.springframework.version}</version>
37+
</dependency>
38+
<dependency>
39+
<groupId>org.springframework</groupId>
40+
<artifactId>spring-websocket</artifactId>
41+
<version>${org.springframework.version}</version>
42+
</dependency>
43+
<dependency>
44+
<groupId>org.springframework</groupId>
45+
<artifactId>spring-messaging</artifactId>
46+
<version>${org.springframework.version}</version>
47+
</dependency>
48+
2249
</dependencies>
2350
<build>
2451
<plugins>
@@ -34,4 +61,9 @@
3461
</plugins>
3562
</build>
3663

64+
<properties>
65+
<!-- Spring -->
66+
<org.springframework.version>4.2.5.RELEASE</org.springframework.version>
67+
<com.sun.faces.version>2.1.7</com.sun.faces.version>
68+
</properties>
3769
</project>

jsf/src/main/java/com/baeldung/springintegration/dao/UserManagementDAOImpl.java

Lines changed: 1 addition & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,3 @@
1-
/*
2-
* To change this template, choose Tools | Templates
3-
* and open the template in the editor.
4-
*/
51
package com.baeldung.springintegration.dao;
62

73
import java.util.ArrayList;
@@ -10,16 +6,13 @@
106
import java.util.logging.Logger;
117
import javax.annotation.PostConstruct;
128

13-
/**
14-
* @author Tayo
15-
*/
169
public class UserManagementDAOImpl extends IUserManagementDAO {
1710

1811
private List<String> users;
1912

2013
@PostConstruct
2114
public void initUserList() {
22-
users = new ArrayList<String>();
15+
users = new ArrayList<>();
2316
}
2417

2518
@Override

jsf/src/main/java/com/baeldung/springintegration/resources/constraints.properties renamed to jsf/src/main/resources/constraints.properties

File renamed without changes.

jsf/src/main/java/com/baeldung/springintegration/resources/messages.properties renamed to jsf/src/main/resources/messages.properties

File renamed without changes.

jsf/src/main/webapp/WEB-INF/applicationContext.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,6 @@
1010
">
1111

1212
<bean class="org.springframework.context.annotation.CommonAnnotationBeanPostProcessor" />
13-
<bean class="com.baeldung.dao.UserManagementDAOImpl" id="userManagementDAO"/>
13+
<bean class="com.baeldung.springintegration.dao.UserManagementDAOImpl" id="userManagementDAO"/>
1414

1515
</beans>

jsf/src/main/webapp/WEB-INF/faces-config.xml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,15 +10,15 @@
1010
<application>
1111
<resource-bundle>
1212
<base-name>
13-
com.baeldung.resources.messages
13+
messages
1414
</base-name>
1515
<var>
1616
msg
1717
</var>
1818
</resource-bundle>
1919
<resource-bundle>
2020
<base-name>
21-
com.baeldung.resources.constraints
21+
constraints
2222
</base-name>
2323
<var>
2424
constraints

jsf/src/main/webapp/index.xhtml

Lines changed: 20 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -1,27 +1,28 @@
11
<?xml version='1.0' encoding='UTF-8' ?>
2-
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
2+
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
3+
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
34
<html xmlns="http://www.w3.org/1999/xhtml"
45
xmlns:h="http://java.sun.com/jsf/html"
56

67
xmlns:f="http://java.sun.com/jsf/core">
78

8-
<h:head>
9-
<title>Baeldung | Register</title>
10-
</h:head>
11-
<h:body>
12-
13-
<h:form>
14-
<f:ajax>
15-
<h:panelGrid id="theGrid" columns="3">
16-
<h:outputText value="Username"/>
17-
<h:inputText id="firstName" binding="#{userNameTextbox}" required="true" requiredMessage="#{msg['message.valueRequired']}" value="#{registration.userName}"/>
18-
<h:message for="firstName" />
19-
<h:commandButton value="#{msg['label.saveButton']}" action="#{registration.theUserDao.createUser(userNameTextbox.value)}"/>
20-
<h:outputText value="#{registration.operationMessage}"/>
21-
</h:panelGrid>
22-
</f:ajax>
23-
</h:form>
24-
25-
</h:body>
9+
<h:head>
10+
<title>Baeldung | Register</title>
11+
</h:head>
12+
<h:body>
13+
<h:form>
14+
<f:ajax>
15+
<h:panelGrid id="theGrid" columns="3">
16+
<h:outputText value="Username"/>
17+
<h:inputText id="firstName" binding="#{userNameTextbox}" required="true"
18+
requiredMessage="#{msg['message.valueRequired']}" value="#{registration.userName}"/>
19+
<h:message for="firstName"/>
20+
<h:commandButton value="#{msg['label.saveButton']}"
21+
action="#{registration.theUserDao.createUser(userNameTextbox.value)}"/>
22+
<h:outputText value="#{registration.operationMessage}"/>
23+
</h:panelGrid>
24+
</f:ajax>
25+
</h:form>
26+
</h:body>
2627
</html>
2728

0 commit comments

Comments
 (0)