Skip to content

Commit

Permalink
Merge pull request #5 from danielfernandez/thymeleaf
Browse files Browse the repository at this point in the history
* danielfernandez-thymeleaf: (22 commits)
  Upgrade to SWF 2.4 M1 and fix git rebase issues
  Modified thymeleaf-extras-* dependencies to version 2.0.0
  Expanded tabs into spaces.
  Fixed unix line feeds.
  Deleted original JSP files.
  Fixed error reporting format.
  Added static content to search.html
  Added static prototyping structures to all templates.
  Small markup fixes.
  Converted booking flow to thymeleaf.
  Added list and show pages
  Added bookingsTable.html, reconfigured JSP layout for old pages.
  Thymeleaf-ied layout and several JSP pages.
  Added dependency to thymeleaf-extras-conditionalcomments
  Created Standard Layout in thymeleaf.
  Added thymeleaf versions of "login" and "logoutSuccess"
  Added first Thymeleaf template to application (intro.html)
  Added log configuration entry for thymeleaf.
  Applied Thymeleaf configuration
  Refactored Tiles version in pom.xml
  ...
  • Loading branch information
rstoyanchev committed Feb 1, 2013
2 parents f45bc3a + 2adb680 commit af960b6
Show file tree
Hide file tree
Showing 37 changed files with 1,509 additions and 717 deletions.
6 changes: 3 additions & 3 deletions booking-faces/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
<properties>
<springframework-version>3.2.1.RELEASE</springframework-version>
<springsecurity-version>3.1.3.RELEASE</springsecurity-version>
<webflow-version>2.4.0.BUILD-SNAPSHOT</webflow-version>
<webflow-version>2.4.0.M1</webflow-version>
<slf4j-version>1.5.10</slf4j-version>
<mojarra-version>2.1.7</mojarra-version>
<primefaces-version>3.1.1</primefaces-version>
Expand All @@ -20,8 +20,8 @@
<repositories>
<repository>
<id>spring-repository</id>
<name>Spring project snapshots, milestones, and releases</name>
<url>http://repo.springsource.org/snapshot</url>
<name>SpringSource Repository</name>
<url>http://repo.springsource.org/milestone</url>
</repository>
<repository>
<id>primefaces-repository</id>
Expand Down
126 changes: 84 additions & 42 deletions booking-mvc/pom.xml
Original file line number Diff line number Diff line change
@@ -1,41 +1,72 @@
<?xml version="1.0" encoding="UTF-8"?>
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
<modelVersion>4.0.0</modelVersion>
<groupId>org.springframework.webflow.samples</groupId>
<artifactId>booking-mvc</artifactId>
<packaging>war</packaging>
<name>Hotel Booking : Spring MVC + Web Flow + JSP</name>
<version>1.0.0.BUILD-SNAPSHOT</version>
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
<modelVersion>4.0.0</modelVersion>
<groupId>org.springframework.webflow.samples</groupId>
<artifactId>booking-mvc</artifactId>
<packaging>war</packaging>
<name>Hotel Booking : Spring MVC + Web Flow + JSP</name>
<version>1.0.0.BUILD-SNAPSHOT</version>

<properties>
<springframework-version>3.2.1.RELEASE</springframework-version>
<springsecurity-version>3.1.3.RELEASE</springsecurity-version>
<webflow-version>2.4.0.BUILD-SNAPSHOT</webflow-version>
<slf4j-version>1.5.10</slf4j-version>
<webflow-version>2.4.0.M1</webflow-version>
<slf4j-version>1.6.1</slf4j-version>
<thymeleaf-version>2.0.15</thymeleaf-version>
<thymeleaf-extras-tiles2-version>2.0.0</thymeleaf-extras-tiles2-version>
<thymeleaf-extras-springsecurity3-version>2.0.0</thymeleaf-extras-springsecurity3-version>
<thymeleaf-extras-conditionalcomments-version>2.0.0</thymeleaf-extras-conditionalcomments-version>
<tiles-version>2.2.2</tiles-version>
</properties>

<repositories>
<repository>
<id>spring-repository</id>
<name>Spring project snapshots, milestones, and releases</name>
<url>http://repo.springsource.org/snapshot</url>
<name>SpringSource Repository</name>
<url>http://repo.springsource.org/milestone</url>
</repository>
</repositories>

<dependencies>

<!-- Thymeleaf -->
<dependency>
<groupId>org.thymeleaf</groupId>
<artifactId>thymeleaf</artifactId>
<version>${thymeleaf-version}</version>
</dependency>
<dependency>
<groupId>org.thymeleaf</groupId>
<artifactId>thymeleaf-spring3</artifactId>
<version>${thymeleaf-version}</version>
</dependency>
<dependency>
<groupId>org.thymeleaf.extras</groupId>
<artifactId>thymeleaf-extras-tiles2</artifactId>
<version>${thymeleaf-extras-tiles2-version}</version>
</dependency>
<dependency>
<groupId>org.thymeleaf.extras</groupId>
<artifactId>thymeleaf-extras-springsecurity3</artifactId>
<version>${thymeleaf-extras-springsecurity3-version}</version>
</dependency>
<dependency>
<groupId>org.thymeleaf.extras</groupId>
<artifactId>thymeleaf-extras-conditionalcomments</artifactId>
<version>${thymeleaf-extras-conditionalcomments-version}</version>
</dependency>

<!-- Spring -->
<dependency>
<groupId>org.springframework</groupId>
<artifactId>spring-web</artifactId>
<version>${springframework-version}</version>
</dependency>
<dependency>
<groupId>org.springframework</groupId>
<artifactId>spring-webmvc</artifactId>
<version>${springframework-version}</version>
<exclusions>
<!-- Exclude Commons Logging in favor of SLF4j -->
<exclusion>
<groupId>commons-logging</groupId>
<artifactId>commons-logging</artifactId>
</exclusion>
</exclusions>
</dependency>
<dependency>
<groupId>org.springframework</groupId>
Expand All @@ -62,14 +93,9 @@
<artifactId>spring-security-web</artifactId>
<version>${springsecurity-version}</version>
<exclusions>
<!-- Exclude Commons Logging in favor of SLF4j -->
<exclusion>
<groupId>commons-logging</groupId>
<artifactId>commons-logging</artifactId>
</exclusion>
<exclusion>
<groupId>org.springframework</groupId>
<artifactId>*</artifactId>
<artifactId>spring-aop</artifactId>
</exclusion>
</exclusions>
</dependency>
Expand All @@ -80,7 +106,7 @@
<exclusions>
<exclusion>
<groupId>org.springframework</groupId>
<artifactId>*</artifactId>
<artifactId>spring-aop</artifactId>
</exclusion>
</exclusions>
</dependency>
Expand All @@ -89,17 +115,13 @@
<artifactId>spring-security-config</artifactId>
<version>${springsecurity-version}</version>
<exclusions>
<!-- Exclude Commons Logging in favor of SLF4j -->
<exclusion>
<groupId>commons-logging</groupId>
<artifactId>commons-logging</artifactId>
</exclusion>
<exclusion>
<groupId>org.springframework</groupId>
<artifactId>*</artifactId>
<artifactId>spring-aop</artifactId>
</exclusion>
</exclusions>
</dependency>

<!-- Logging -->
<dependency>
<groupId>org.slf4j</groupId>
Expand Down Expand Up @@ -141,6 +163,7 @@
</exclusions>
<scope>runtime</scope>
</dependency>

<!-- Database, JPA -->
<dependency>
<groupId>org.hsqldb</groupId>
Expand All @@ -153,6 +176,7 @@
<artifactId>hibernate-entitymanager</artifactId>
<version>3.5.0-Final</version>
</dependency>

<!-- Servlet -->
<dependency>
<groupId>javax.servlet</groupId>
Expand All @@ -171,19 +195,34 @@
<artifactId>jstl</artifactId>
<version>1.2</version>
</dependency>

<!-- Apache Tiles -->
<dependency>
<groupId>org.apache.tiles</groupId>
<artifactId>tiles-core</artifactId>
<version>${tiles-version}</version>
</dependency>
<dependency>
<groupId>org.apache.tiles</groupId>
<artifactId>tiles-api</artifactId>
<version>${tiles-version}</version>
</dependency>
<dependency>
<groupId>org.apache.tiles</groupId>
<artifactId>tiles-template</artifactId>
<version>${tiles-version}</version>
</dependency>
<dependency>
<groupId>org.apache.tiles</groupId>
<artifactId>tiles-servlet</artifactId>
<version>${tiles-version}</version>
</dependency>
<dependency>
<groupId>org.apache.tiles</groupId>
<artifactId>tiles-jsp</artifactId>
<version>2.1.3</version>
<exclusions>
<!-- Exclude Commons Logging in favor of SLF4j -->
<exclusion>
<groupId>commons-logging</groupId>
<artifactId>commons-logging-api</artifactId>
</exclusion>
</exclusions>
<version>${tiles-version}</version>
</dependency>

<!-- JSR 303 with Hibernate Validator -->
<dependency>
<groupId>org.hibernate</groupId>
Expand All @@ -200,6 +239,7 @@
<artifactId>jaxb-api</artifactId>
<version>2.1</version>
</dependency>

<!-- Joda Time -->
<dependency>
<groupId>joda-time</groupId>
Expand All @@ -212,6 +252,7 @@
<version>1.0.2</version>
<scope>runtime</scope>
</dependency>

<!-- Test -->
<dependency>
<groupId>org.easymock</groupId>
Expand Down Expand Up @@ -248,7 +289,7 @@
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-surefire-plugin</artifactId>
<version>2.12</version>
<version>2.12</version>
<configuration>
<junitArtifactName>junit:junit</junitArtifactName>
<includes>
Expand All @@ -264,13 +305,14 @@
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-eclipse-plugin</artifactId>
<version>2.8</version>
<version>2.9</version>
<configuration>
<downloadSources>true</downloadSources>
<downloadJavadocs>false</downloadJavadocs>
<wtpversion>2.0</wtpversion>
</configuration>
</plugin>
</plugin>
</plugins>
</build>

</project>
6 changes: 5 additions & 1 deletion booking-mvc/src/main/resources/log4j.xml
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,11 @@
<logger name="org.springframework.webflow">
<level value="debug" />
</logger>


<logger name="org.thymeleaf">
<level value="info" />
</logger>

<!-- Root Logger -->
<root>
<priority value="warn" />
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,8 @@
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns:tx="http://www.springframework.org/schema/tx"
xsi:schemaLocation="
http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-3.0.xsd
http://www.springframework.org/schema/tx http://www.springframework.org/schema/tx/spring-tx-3.0.xsd">
http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-3.1.xsd
http://www.springframework.org/schema/tx http://www.springframework.org/schema/tx/spring-tx-3.1.xsd">

<!-- Instructs Spring to perfrom declarative transaction management on annotated classes -->
<tx:annotation-driven />
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
http://www.springframework.org/schema/security http://www.springframework.org/schema/security/spring-security-3.1.xsd">

<!-- Configure Spring Security -->
<security:http auto-config="true">
<security:http auto-config="true" use-expressions="true">
<security:form-login login-page="/login" login-processing-url="/loginProcess"
default-target-url="/hotels/search" authentication-failure-url="/login?login_error=1" />
<security:logout logout-url="/logout" logout-success-url="/logoutSuccess" />
Expand All @@ -34,4 +34,4 @@
</security:authentication-provider>
</security:authentication-manager>

</beans>
</beans>
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,8 @@
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns:context="http://www.springframework.org/schema/context"
xsi:schemaLocation="
http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-3.0.xsd
http://www.springframework.org/schema/context http://www.springframework.org/schema/context/spring-context-3.0.xsd">
http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-3.1.xsd
http://www.springframework.org/schema/context http://www.springframework.org/schema/context/spring-context-3.1.xsd">

<!-- Scans for application @Components to deploy -->
<context:component-scan base-package="org.springframework.webflow.samples.booking" />
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns:webflow="http://www.springframework.org/schema/webflow-config"
xsi:schemaLocation="
http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-3.0.xsd
http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-3.1.xsd
http://www.springframework.org/schema/webflow-config http://www.springframework.org/schema/webflow-config/spring-webflow-config-2.3.xsd">

<!-- Executes flows: the entry point into the Spring Web Flow system -->
Expand Down
53 changes: 37 additions & 16 deletions booking-mvc/src/main/webapp/WEB-INF/config/webmvc-config.xml
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,8 @@
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns:mvc="http://www.springframework.org/schema/mvc"
xsi:schemaLocation="
http://www.springframework.org/schema/mvc http://www.springframework.org/schema/mvc/spring-mvc-3.0.xsd
http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-3.0.xsd">
http://www.springframework.org/schema/mvc http://www.springframework.org/schema/mvc/spring-mvc-3.1.xsd
http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-3.1.xsd">

<!-- Enables controllers mapped with @RequestMapping annotations, formatting annotations @NumberFormat @DateTimeFormat, and JSR 303 style validation -->
<mvc:annotation-driven/>
Expand All @@ -23,20 +23,6 @@
<mvc:view-controller path="/login" />
<mvc:view-controller path="/logoutSuccess" />

<!-- Resolves logical view names returned by Controllers to Tiles; a view name to resolve is treated as the name of a tiles definition -->
<bean id="tilesViewResolver" class="org.springframework.js.ajax.AjaxUrlBasedViewResolver">
<property name="viewClass" value="org.springframework.webflow.mvc.view.FlowAjaxTilesView"/>
</bean>

<!-- Configures the Tiles layout system -->
<bean id="tilesConfigurer" class="org.springframework.web.servlet.view.tiles2.TilesConfigurer">
<property name="definitions">
<list>
<value>/WEB-INF/**/views.xml</value>
</list>
</property>
</bean>

<!-- Dispatches requests mapped to flows to FlowHandler implementations -->
<bean class="org.springframework.webflow.mvc.servlet.FlowHandlerAdapter">
<property name="flowExecutor" ref="flowExecutor"/>
Expand All @@ -46,4 +32,39 @@
<!-- Custom FlowHandler for the hotel booking flow -->
<bean name="hotels/booking" class="org.springframework.webflow.samples.booking.BookingFlowHandler" />

<!-- Thymeleaf template resolver -->
<bean id="templateResolver"
class="org.thymeleaf.templateresolver.ServletContextTemplateResolver">
<property name="prefix" value="/WEB-INF/" />
<property name="templateMode" value="HTML5" />
</bean>

<!-- Thymeleaf Template Engine -->
<bean id="templateEngine"
class="org.thymeleaf.spring3.SpringTemplateEngine">
<property name="templateResolver" ref="templateResolver" />
<property name="additionalDialects">
<set>
<bean class="org.thymeleaf.extras.tiles2.dialect.TilesDialect"/>
<bean class="org.thymeleaf.extras.springsecurity3.dialect.SpringSecurityDialect"/>
<bean class="org.thymeleaf.extras.conditionalcomments.dialect.ConditionalCommentsDialect"/>
</set>
</property>
</bean>

<!-- Resolves logical view names returned by Controllers to Tiles; a view name to resolve is treated as the name of a tiles definition -->
<bean id="tilesViewResolver" class="org.thymeleaf.spring3.view.AjaxThymeleafViewResolver">
<property name="viewClass" value="org.thymeleaf.extras.tiles2.spring.web.view.FlowAjaxThymeleafTilesView"/>
<property name="templateEngine" ref="templateEngine"/>
</bean>

<!-- Configures the Tiles layout system using a specific thymeleaf-enabled Tiles Configurer -->
<bean id="tilesConfigurer" class="org.thymeleaf.extras.tiles2.spring.web.configurer.ThymeleafTilesConfigurer">
<property name="definitions">
<list>
<value>/WEB-INF/**/views.xml</value>
</list>
</property>
</bean>

</beans>
Loading

0 comments on commit af960b6

Please sign in to comment.