Switch from JSP to Thymeleaf views

This is a revert of commit 758596 which did the opposite, "temporarily"
while Thymeleaf support wasn't yet available.
This commit is contained in:
rstoyanchev
2022-07-15 12:55:09 +01:00
parent 2b42fa3736
commit 6f82ff3f3f
30 changed files with 1408 additions and 653 deletions

View File

@@ -45,7 +45,7 @@ public class WebFlowConfig extends AbstractFlowConfiguration {
@Bean
public MvcViewFactoryCreator mvcViewFactoryCreator() {
MvcViewFactoryCreator factoryCreator = new MvcViewFactoryCreator();
factoryCreator.setViewResolvers(Collections.singletonList(this.webMvcConfig.viewResolver()));
factoryCreator.setViewResolvers(Collections.singletonList(this.webMvcConfig.tilesViewResolver()));
factoryCreator.setUseSpringBeanBinding(true);
return factoryCreator;
}

View File

@@ -1,5 +1,8 @@
package org.springframework.webflow.samples.booking.config;
import java.util.LinkedHashSet;
import java.util.Set;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
@@ -7,16 +10,23 @@ import org.springframework.web.servlet.config.annotation.DefaultServletHandlerCo
import org.springframework.web.servlet.config.annotation.EnableWebMvc;
import org.springframework.web.servlet.config.annotation.ResourceHandlerRegistry;
import org.springframework.web.servlet.config.annotation.ViewControllerRegistry;
import org.springframework.web.servlet.config.annotation.WebMvcConfigurer;
import org.springframework.web.servlet.view.InternalResourceViewResolver;
import org.springframework.web.servlet.view.UrlBasedViewResolver;
import org.springframework.web.servlet.config.annotation.WebMvcConfigurerAdapter;
import org.springframework.webflow.mvc.servlet.FlowHandlerAdapter;
import org.springframework.webflow.mvc.servlet.FlowHandlerMapping;
import org.springframework.webflow.samples.booking.BookingFlowHandler;
import org.thymeleaf.dialect.IDialect;
import org.thymeleaf.extras.conditionalcomments.dialect.ConditionalCommentsDialect;
import org.thymeleaf.extras.springsecurity4.dialect.SpringSecurityDialect;
import org.thymeleaf.extras.tiles2.dialect.TilesDialect;
import org.thymeleaf.extras.tiles2.spring4.web.configurer.ThymeleafTilesConfigurer;
import org.thymeleaf.extras.tiles2.spring4.web.view.FlowAjaxThymeleafTilesView;
import org.thymeleaf.spring4.SpringTemplateEngine;
import org.thymeleaf.spring4.view.AjaxThymeleafViewResolver;
import org.thymeleaf.templateresolver.ServletContextTemplateResolver;
@EnableWebMvc
@Configuration
public class WebMvcConfig implements WebMvcConfigurer {
public class WebMvcConfig extends WebMvcConfigurerAdapter {
@Autowired
private WebFlowConfig webFlowConfig;
@@ -60,8 +70,40 @@ public class WebMvcConfig implements WebMvcConfigurer {
}
@Bean
public UrlBasedViewResolver viewResolver() {
return new InternalResourceViewResolver();
public AjaxThymeleafViewResolver tilesViewResolver() {
AjaxThymeleafViewResolver viewResolver = new AjaxThymeleafViewResolver();
viewResolver.setViewClass(FlowAjaxThymeleafTilesView.class);
viewResolver.setTemplateEngine(templateEngine());
return viewResolver;
}
@Bean
public SpringTemplateEngine templateEngine(){
Set<IDialect> dialects = new LinkedHashSet<IDialect>();
dialects.add(new TilesDialect());
dialects.add(new SpringSecurityDialect());
dialects.add(new ConditionalCommentsDialect());
SpringTemplateEngine templateEngine = new SpringTemplateEngine();
templateEngine.setTemplateResolver(templateResolver());
templateEngine.setAdditionalDialects(dialects);
return templateEngine;
}
@Bean
public ServletContextTemplateResolver templateResolver() {
ServletContextTemplateResolver templateResolver = new ServletContextTemplateResolver();
templateResolver.setPrefix("/WEB-INF");
templateResolver.setTemplateMode("HTML5");
return templateResolver;
}
@Bean
public ThymeleafTilesConfigurer tilesConfigurer() {
ThymeleafTilesConfigurer configurer = new ThymeleafTilesConfigurer();
configurer.setDefinitions("/WEB-INF/**/views.xml");
return configurer;
}
}

View File

@@ -0,0 +1,274 @@
<!DOCTYPE html>
<html xmlns="http://www.w3.org/1999/xhtml"
xmlns:th="http://www.thymeleaf.org"
xmlns:tiles="http://www.thymeleaf.org"
xmlns:sec="http://www.thymeleaf.org"
lang="en">
<head>
<!-- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -->
<!-- This <head> section is only used for static prototyping purposes. At runtime, -->
<!-- Tiles will only use the body fragment defined with tiles:fragment="content", -->
<!-- as specified at the corresponding views.xml file. -->
<!-- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -->
<title>Spring Travel: Spring MVC and Web Flow Reference Application</title>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
<link rel="stylesheet" type="text/css" media="screen, projection"
href="../../../styles/blueprint/screen.css" />
<link rel="stylesheet" type="text/css" media="print"
href="../../../styles/blueprint/print.css" />
<!--[if lt IE 8]>
<link rel="stylesheet" type="text/css" media="screen, projection"
href="../../../styles/blueprint/ie.css" />
<![endif]-->
<link rel="stylesheet" type="text/css" media="screen"
href="../../../styles/booking.css" />
<!-- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -->
<!-- Some styles and scripts are served from spring-js-resources-{ver}.jar at -->
<!-- runtime. Therefore not available for static prototyping. See the -->
<!-- layouts/standard.html template file for detail. -->
<!-- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -->
</head>
<!-- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -->
<!-- START of the content to be included in the execution result. -->
<!-- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -->
<!-- Only the markup inside this <body> would be required in this -->
<!-- template if no static prototyping was intended. -->
<!-- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -->
<body tiles:fragment="content">
<div id="bookingForm">
<div class="span-5">
<h3 th:text="${booking.hotel.name}">The Herb Plaza</h3>
<address th:object="${booking.hotel}">
<span th:text="*{address}">Thyme Square, 13</span>
<br />
<span th:text="*{city}">Icetown</span>,
<span th:text="*{state}">North Pole</span>,
<span th:text="*{zip}">0W</span>
<br />
<span th:text="*{country}">Earth</span>
</address>
<p>
Nightly rate: <span th:text="${booking.hotel.price}">400.00</span>
</p>
</div>
<div class="span-12">
<form id="booking" action="#" th:object="${booking}" th:action="${flowExecutionUrl}" method="post">
<div class="error" th:if="${#fields.hasErrors('*')}">
<span th:each="err : ${#fields.errors('*')}">
<span th:text="${err}">Input is incorrect</span><br />
</span>
</div>
<fieldset>
<legend>Book Hotel</legend>
<div>
<div class="span-4">
<label for="checkinDate">Check In:</label>
</div>
<div class="span-7 last">
<p><input type="text" th:field="*{checkinDate}" /></p>
<script type="text/javascript">
// <![CDATA[
Spring.addDecoration(new Spring.ElementDecoration({
elementId : "checkinDate",
widgetType : "dijit.form.DateTextBox",
widgetAttrs : { datePattern : "MM-dd-yyyy", required : true }}));
// ]]>
</script>
</div>
</div>
<div>
<div class="span-4">
<label for="checkoutDate">Check Out:</label>
</div>
<div class="span-7 last">
<p><input type="text" th:field="*{checkoutDate}" /></p>
<script type="text/javascript">
// <![CDATA[
Spring.addDecoration(new Spring.ElementDecoration({
elementId : "checkoutDate",
widgetType : "dijit.form.DateTextBox",
widgetAttrs : { datePattern : "MM-dd-yyyy", required : true }}));
// ]]>
</script>
</div>
</div>
<div>
<div class="span-4">
<label for="beds">Room Preference:</label>
</div>
<div class="span-7 last">
<p>
<select th:field="*{beds}">
<option label="One king-size bed" value="1">One king-size bed</option>
<option label="Two double beds" value="2" >Two double beds</option>
<option label="Three beds" value="3" >Three beds</option>
</select>
</p>
</div>
</div>
<div>
<div class="label span-4">
Smoking Preference:
</div>
<div id="radio" class="span-7 last">
<p>
<input type="radio" id="smoking" th:field="*{smoking}" value="true" /><label for="smoking">Smoking</label>
<input type="radio" id="non-smoking" th:field="*{smoking}" value="false" /><label for="non-smoking">Non Smoking</label>
</p>
<script type="text/javascript">
// <![CDATA[
Spring.addDecoration(new Spring.ElementDecoration({
elementId : 'smoking',
widgetType : "dijit.form.RadioButton",
widgetModule : "dijit.form.CheckBox",
widgetAttrs : { value : "true" }
}));
Spring.addDecoration(new Spring.ElementDecoration({
elementId : 'non-smoking',
widgetType : "dijit.form.RadioButton",
widgetModule : "dijit.form.CheckBox",
widgetAttrs : { value : "false" }
}));
// ]]>
</script>
</div>
</div>
<div>
<div class="label span-4">
Amenities:
</div>
<div id="amenities" class="span-7 last">
<p>
<input type="checkbox" th:field="*{amenities}" value="OCEAN_VIEW" /><label th:for="${#ids.prev('amenities')}">Ocean View</label>
<br />
<input type="checkbox" th:field="*{amenities}" value="LATE_CHECKOUT" /><label th:for="${#ids.prev('amenities')}">Late Checkout</label>
<br />
<input type="checkbox" th:field="*{amenities}" value="MINIBAR" /><label th:for="${#ids.prev('amenities')}">Minibar</label>
</p>
<script type="text/javascript">
// <![CDATA[
dojo.query("#amenities input[type='checkbox']").forEach(function(element){
Spring.addDecoration(new Spring.ElementDecoration({
elementId: element.id,
widgetType : "dijit.form.CheckBox",
widgetAttrs : { checked : element.checked }
}));
});
// ]]>
</script>
</div>
</div>
<div>
<div class="span-4">
<label for="creditCard">Credit Card #:</label>
</div>
<div class="span-7 last">
<p><input type="text" th:field="*{creditCard}" /></p>
<script type="text/javascript">
// <![CDATA[
Spring.addDecoration(new Spring.ElementDecoration({
elementId : "creditCard",
widgetType : "dijit.form.ValidationTextBox",
widgetAttrs : { required : true, invalidMessage : "A 16-digit credit card number is required.",
regExp : "[0-9]{16}" }}));
// ]]>
</script>
</div>
</div>
<div>
<div class="span-4">
<label for="creditCardName">Credit Card Name:</label>
</div>
<div class="span-7 last">
<p><input type="text" th:field="*{creditCardName}" maxlength="40" /></p>
<script type="text/javascript">
// <![CDATA[
Spring.addDecoration(new Spring.ElementDecoration({
elementId : "creditCardName",
widgetType : "dijit.form.ValidationTextBox",
widgetAttrs : { required : true }}));
// ]]>
</script>
</div>
</div>
<div>
<div class="span-4">
<label for="creditCardExpiryMonth">Expiration Date:</label>
</div>
<div class="span-7 last">
<p>
<select th:field="*{creditCardExpiryMonth}">
<option value="1">Jan</option>
<option value="2">Feb</option>
<option value="3">Mar</option>
<option value="4">Apr</option>
<option value="5">May</option>
<option value="6">Jun</option>
<option value="7">Jul</option>
<option value="8">Aug</option>
<option value="9">Sep</option>
<option value="10">Oct</option>
<option value="11">Nov</option>
<option value="12">Dec</option>
</select>
<select th:field="*{creditCardExpiryYear}">
<option value="1">2008</option>
<option value="2">2009</option>
<option value="3">2010</option>
<option value="4">2011</option>
<option value="5">2012</option>
</select>
</p>
</div>
</div>
<div>
<p>
<button type="submit" id="proceed" name="_eventId_proceed">Proceed</button>
<button type="submit" name="_eventId_cancel" >Cancel</button>
</p>
<script type="text/javascript">
// <![CDATA[
Spring.addDecoration(new Spring.ValidateAllDecoration({elementId:'proceed', event:'onclick'}));
Spring.addDecoration(new Spring.AjaxEventDecoration({elementId:'proceed',event:'onclick',formId:'booking'}));
// ]]>
</script>
</div>
</fieldset>
</form>
</div>
</div>
</body>
<!-- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -->
<!-- END of the content to be included in the execution result -->
<!-- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -->
</html>

View File

@@ -1,192 +0,0 @@
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<%@ taglib prefix="spring" uri="http://www.springframework.org/tags" %>
<%@ taglib prefix="form" uri="http://www.springframework.org/tags/form" %>
<div id="bookingForm">
<div class="span-5">
<h3>${booking.hotel.name}</h3>
<address>
${booking.hotel.address}
<br/>
${booking.hotel.city}, ${booking.hotel.state}, ${booking.hotel.zip}
<br/>
${booking.hotel.country}
</address>
<p>
Nightly rate: <spring:bind path="booking.hotel.price">${status.value}</spring:bind>
</p>
</div>
<div class="span-12">
<spring:hasBindErrors name="booking">
<div class="error">
<spring:bind path="booking.*">
<c:forEach items="${status.errorMessages}" var="error">
<span><c:out value="${error}"/></span><br>
</c:forEach>
</spring:bind>
</div>
</spring:hasBindErrors>
<form:form modelAttribute="booking" action="${flowExecutionUrl}">
<fieldset>
<legend>Book Hotel</legend>
<div>
<div class="span-4">
<label for="checkinDate">Check In:</label>
</div>
<div class="last">
<p><form:input path="checkinDate"/></p>
<script type="text/javascript">
Spring.addDecoration(new Spring.ElementDecoration({
elementId : "checkinDate",
widgetType : "dijit.form.DateTextBox",
widgetAttrs : { datePattern : "MM-dd-yyyy", required : true }}));
</script>
</div>
</div>
<div>
<div class="span-4">
<label for="checkoutDate">Check Out:</label>
</div>
<div class="last">
<p><form:input path="checkoutDate"/></p>
<script type="text/javascript">
Spring.addDecoration(new Spring.ElementDecoration({
elementId : "checkoutDate",
widgetType : "dijit.form.DateTextBox",
widgetAttrs : { datePattern : "MM-dd-yyyy", required : true }}));
</script>
</div>
</div>
<div>
<div class="span-4">
<label for="beds">Room Preference:</label>
</div>
<div class="last">
<p>
<form:select id="beds" path="beds">
<form:option label="One king-size bed" value="1"/>
<form:option label="Two double beds" value="2"/>
<form:option label="Three beds" value="3"/>
</form:select>
</p>
</div>
</div>
<div>
<div class="label">
<label for="radio">Smoking Preference:</label>
</div>
<div id="radio">
<p>
<form:radiobutton id="smoking" path="smoking" label="Smoking" value="true"/>
<form:radiobutton id="non-smoking" path="smoking" label="Non Smoking" value="false"/>
</p>
<script type="text/javascript">
Spring.addDecoration(new Spring.ElementDecoration({
elementId : 'smoking',
widgetType : "dijit.form.RadioButton",
widgetModule : "dijit.form.CheckBox",
widgetAttrs : { value : "true" }
}));
Spring.addDecoration(new Spring.ElementDecoration({
elementId : 'non-smoking',
widgetType : "dijit.form.RadioButton",
widgetModule : "dijit.form.CheckBox",
widgetAttrs : { value : "false" }
}));
</script>
</div>
</div>
<div>
<div>
<label for="amenities">Amenities:</label>
</div>
<div id="amenities">
<p>
<form:checkbox path="amenities" value="OCEAN_VIEW" label="Ocean View" />
<form:checkbox path="amenities" value="LATE_CHECKOUT" label="Late Checkout" />
<form:checkbox path="amenities" value="MINIBAR" label="Minibar" />
</p>
<script type="text/javascript">
dojo.query("#amenities input[type='checkbox']").forEach(function(element){
Spring.addDecoration(new Spring.ElementDecoration({
elementId: element.id,
widgetType : "dijit.form.CheckBox",
widgetAttrs : { checked : element.checked }
}));
});
</script>
</div>
</div>
<div>
<div class="span-4">
<label for="creditCard">Credit Card #:</label>
</div>
<div class="last">
<p><form:input path="creditCard"/></p>
<script type="text/javascript">
Spring.addDecoration(new Spring.ElementDecoration({
elementId : "creditCard",
widgetType : "dijit.form.ValidationTextBox",
widgetAttrs : { required : true, invalidMessage : "A 16-digit credit card number is required.",
regExp : "[0-9]{16}" }}));
</script>
</div>
</div>
<div>
<div class="span-4">
<label for="creditCardName">Credit Card Name:</label>
</div>
<div class="last">
<p><form:input path="creditCardName" maxlength="40"/></p>
<script type="text/javascript">
Spring.addDecoration(new Spring.ElementDecoration({
elementId : "creditCardName",
widgetType : "dijit.form.ValidationTextBox",
widgetAttrs : { required : true }}));
</script>
</div>
</div>
<div>
<div class="span-4">
<label for="creditCardExpiryMonth">Expiration Date:</label>
</div>
<div class="last">
<p>
<form:select id="creditCardExpiryMonth" path="creditCardExpiryMonth">
<form:option label="Jan" value="1"/>
<form:option label="Feb" value="2"/>
<form:option label="Mar" value="3"/>
<form:option label="Apr" value="4"/>
<form:option label="May" value="5"/>
<form:option label="Jun" value="6"/>
<form:option label="Jul" value="7"/>
<form:option label="Aug" value="8"/>
<form:option label="Sep" value="9"/>
<form:option label="Oct" value="10"/>
<form:option label="Nov" value="11"/>
<form:option label="Dec" value="12"/>
</form:select>
<form:select path="creditCardExpiryYear">
<form:option label="2008" value="1"/>
<form:option label="2009" value="2"/>
<form:option label="2010" value="3"/>
<form:option label="2011" value="4"/>
<form:option label="2012" value="5"/>
</form:select>
</p>
</div>
</div>
<div>
<button type="submit" id="proceed" name="_eventId_proceed">Proceed</button>
<button type="submit" name="_eventId_cancel" >Cancel</button>
<script type="text/javascript">
Spring.addDecoration(new Spring.ValidateAllDecoration({elementId:'proceed', event:'onclick'}));
Spring.addDecoration(new Spring.AjaxEventDecoration({elementId:'proceed',event:'onclick',formId:'booking'}));
</script>
</div>
</fieldset>
</form:form>
</div>
</div>

View File

@@ -0,0 +1,65 @@
<!DOCTYPE html>
<html xmlns="http://www.w3.org/1999/xhtml"
xmlns:th="http://www.thymeleaf.org"
xmlns:tiles="http://www.thymeleaf.org"
xmlns:sec="http://www.thymeleaf.org"
lang="en">
<head>
<!-- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -->
<!-- This <head> section is only used for static prototyping purposes. At runtime, -->
<!-- Tiles will only use the body fragment defined with tiles:fragment="content", -->
<!-- as specified at the corresponding views.xml file. -->
<!-- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -->
<title>Spring Travel: Spring MVC and Web Flow Reference Application</title>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
<link rel="stylesheet" type="text/css" media="screen, projection"
href="../../../styles/blueprint/screen.css" />
<link rel="stylesheet" type="text/css" media="print"
href="../../../styles/blueprint/print.css" />
<!--[if lt IE 8]>
<link rel="stylesheet" type="text/css" media="screen, projection"
href="../../../styles/blueprint/ie.css" />
<![endif]-->
<link rel="stylesheet" type="text/css" media="screen"
href="../../../styles/booking.css" />
<!-- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -->
<!-- Some styles and scripts are served from spring-js-resources-{ver}.jar at -->
<!-- runtime. Therefore not available for static prototyping. See the -->
<!-- layouts/standard.html template file for detail. -->
<!-- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -->
</head>
<!-- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -->
<!-- START of the content to be included in the execution result. -->
<!-- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -->
<!-- Only the markup inside this <body> would be required in this -->
<!-- template if no static prototyping was intended. -->
<!-- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -->
<body tiles:fragment="content">
<div id="messages">
<ul th:if="${#fields.hasErrors('*')}" class="errors">
<li th:each="err : ${#fields.errors('*')}" th:text="${err}">Input is incorrect</li>
</ul>
</div>
</body>
<!-- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -->
<!-- END of the content to be included in the execution result -->
<!-- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -->
</html>

View File

@@ -1,5 +0,0 @@
<%@ taglib prefix="form" uri="http://www.springframework.org/tags/form" %>
<div id="messages">
<form:errors path="booking.*" cssClass="errors" />
</div>

View File

@@ -0,0 +1,135 @@
<!DOCTYPE html>
<html xmlns="http://www.w3.org/1999/xhtml"
xmlns:th="http://www.thymeleaf.org"
xmlns:tiles="http://www.thymeleaf.org"
xmlns:sec="http://www.thymeleaf.org"
lang="en">
<head>
<!-- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -->
<!-- This <head> section is only used for static prototyping purposes. At runtime, -->
<!-- Tiles will only use the body fragment defined with tiles:fragment="content", -->
<!-- as specified at the corresponding views.xml file. -->
<!-- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -->
<title>Spring Travel: Spring MVC and Web Flow Reference Application</title>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
<link rel="stylesheet" type="text/css" media="screen, projection"
href="../../../styles/blueprint/screen.css" />
<link rel="stylesheet" type="text/css" media="print"
href="../../../styles/blueprint/print.css" />
<!--[if lt IE 8]>
<link rel="stylesheet" type="text/css" media="screen, projection"
href="../../../styles/blueprint/ie.css" />
<![endif]-->
<link rel="stylesheet" type="text/css" media="screen"
href="../../../styles/booking.css" />
<!-- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -->
<!-- Some styles and scripts are served from spring-js-resources-{ver}.jar at -->
<!-- runtime. Therefore not available for static prototyping. See the -->
<!-- layouts/standard.html template file for detail. -->
<!-- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -->
</head>
<!-- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -->
<!-- START of the content to be included in the execution result. -->
<!-- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -->
<!-- Only the markup inside this <body> would be required in this -->
<!-- template if no static prototyping was intended. -->
<!-- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -->
<body tiles:fragment="content">
<div id="bookingForm">
<div class="span-5">
<h3 th:text="${booking.hotel.name}">The Herb Plaza</h3>
<address th:object="${booking.hotel}">
<span th:text="*{address}">Thyme Square, 13</span>
<br />
<span th:text="*{city}">Icetown</span>,
<span th:text="*{state}">North Pole</span>,
<span th:text="*{zip}">0W</span>
<br />
<span th:text="*{country}">Earth</span>
</address>
</div>
<div class="span-12 last">
<form id="confirm" action="#" method="post" th:object="${booking}" th:action="${flowExecutionUrl}">
<fieldset>
<legend>Confirm Booking Details</legend>
<div>
<div class="span-3">Check In:</div>
<div class="span-8 last">
<p th:text="*{checkinDate}">2012-12-21</p>
</div>
</div>
<div>
<div class="span-3">Checkout:</div>
<div class="span-8 last">
<p th:text="*{checkoutDate}">2012-12-21</p>
</div>
</div>
<div>
<div class="span-3">Number of Nights:</div>
<div class="span-8 last">
<p th:text="*{nights}">0</p>
</div>
</div>
<div>
<div class="span-3">Total Payment:</div>
<div class="span-8 last">
<p th:text="*{total}">400.00</p>
</div>
</div>
<div>
<div class="span-3">Credit Card #:</div>
<div class="span-8 last">
<p th:text="*{creditCard}">1234123412341234</p>
</div>
</div>
<div>
<p>
<button type="submit" name="_eventId_confirm">Confirm</button>
<button type="submit" name="_eventId_revise" id="revise">Revise</button>
<button type="submit" name="_eventId_cancel">Cancel</button>
</p>
<script type="text/javascript">
// <![CDATA[
Spring.addDecoration(new Spring.AjaxEventDecoration({elementId:'revise',event:'onclick',formId:'confirm'}));
// ]]>
</script>
</div>
</fieldset>
</form>
</div>
</div>
</body>
<!-- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -->
<!-- END of the content to be included in the execution result -->
<!-- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -->
</html>

View File

@@ -1,63 +0,0 @@
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<%@ taglib prefix="spring" uri="http://www.springframework.org/tags" %>
<%@ taglib prefix="form" uri="http://www.springframework.org/tags/form" %>
<div id="bookingForm">
<div class="span-5">
<h3>${booking.hotel.name}</h3>
<address>
${booking.hotel.address}
<br/>
${booking.hotel.city}, ${booking.hotel.state}, ${booking.hotel.zip}
<br/>
${booking.hotel.country}
</address>
</div>
<div class="span-12 last">
<form:form id="confirm" modelAttribute="booking" action="${flowExecutionUrl}">
<fieldset>
<legend>Confirm Booking Details</legend>
<div>
<div class="span-4">Check In:</div>
<div class="last">
<p><spring:bind path="checkinDate">${status.value}</spring:bind></p>
</div>
</div>
<div>
<div class="span-4">Checkout:</div>
<div class="last">
<p><spring:bind path="checkoutDate">${status.value}</spring:bind></p>
</div>
</div>
<div>
<div class="span-4">Number of Nights:</div>
<div class="last">
<p><spring:bind path="nights">${status.value}</spring:bind></p>
</div>
</div>
<div>
<div class="span-4">Total Payment:</div>
<div class="last">
<p><spring:bind path="total">${status.value}</spring:bind></p>
</div>
</div>
<div>
<div class="span-4">Credit Card #:</div>
<div class="last">
<p>${booking.creditCard}</p>
</div>
</div>
<div>
<button type="submit" name="_eventId_confirm">Confirm</button>
<button type="submit" name="_eventId_revise" id="revise">Revise</button>
<button type="submit" name="_eventId_cancel">Cancel</button>
<script type="text/javascript">
Spring.addDecoration(new Spring.AjaxEventDecoration({elementId:'revise',event:'onclick',formId:'confirm'}));
</script>
</div>
</fieldset>
</form:form>
</div>
</div>

View File

@@ -2,15 +2,15 @@
<!DOCTYPE tiles-definitions PUBLIC
"-//Apache Software Foundation//DTD Tiles Configuration 3.0//EN"
"https://tiles.apache.org/dtds/tiles-config_3_0.dtd">
<tiles-definitions>
<definition name="enterBookingDetails" extends="standardLayout">
<put-attribute name="body" value="/WEB-INF/hotels/booking/enterBookingDetails.jsp"/>
<definition name="enterBookingDetails" extends="standardLayout" templateType="thymeleaf">
<put-attribute name="body" value="/hotels/booking/enterBookingDetails.html :: content" type="thymeleaf"/>
</definition>
<definition name="reviewBooking" extends="standardLayout">
<put-attribute name="body" value="/WEB-INF/hotels/booking/reviewBooking.jsp" />
<definition name="reviewBooking" extends="standardLayout" templateType="thymeleaf">
<put-attribute name="body" value="/hotels/booking/reviewBooking.html :: content" type="thymeleaf"/>
</definition>
</tiles-definitions>

View File

@@ -0,0 +1,96 @@
<!DOCTYPE html>
<html xmlns="http://www.w3.org/1999/xhtml"
xmlns:th="http://www.thymeleaf.org"
xmlns:tiles="http://www.thymeleaf.org"
xmlns:sec="http://www.thymeleaf.org"
lang="en">
<head>
<!-- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -->
<!-- This <head> section is only used for static prototyping purposes. At runtime, -->
<!-- Tiles will only use the body fragment defined with tiles:fragment="content", -->
<!-- as specified at the corresponding views.xml file. -->
<!-- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -->
<title>Spring Travel: Spring MVC and Web Flow Reference Application</title>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
<link rel="stylesheet" type="text/css" media="screen, projection"
href="../../styles/blueprint/screen.css" />
<link rel="stylesheet" type="text/css" media="print"
href="../../styles/blueprint/print.css" />
<!--[if lt IE 8]>
<link rel="stylesheet" type="text/css" media="screen, projection"
href="../../styles/blueprint/ie.css" />
<![endif]-->
<link rel="stylesheet" type="text/css" media="screen"
href="../../styles/booking.css" />
<!-- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -->
<!-- Some styles and scripts are served from spring-js-resources-{ver}.jar at -->
<!-- runtime. Therefore not available for static prototyping. See the -->
<!-- layouts/standard.html template file for detail. -->
<!-- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -->
</head>
<!-- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -->
<!-- START of the content to be included in the execution result. -->
<!-- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -->
<!-- Only the markup inside this <body> would be required in this -->
<!-- template if no static prototyping was intended. -->
<!-- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -->
<body tiles:fragment="content">
<div id="bookings" sec:authorize="hasRole('ROLE_USER')">
<h2>Current Hotel Bookings</h2>
<p th:unless="${bookingList}">
No bookings found
</p>
<table class="summary" th:if="${bookingList}">
<thead>
<tr>
<th>Name</th>
<th>Address</th>
<th>City, State</th>
<th>Check in Date</th>
<th>Check out Date</th>
<th>Confirmation Number</th>
<th>Action</th>
</tr>
</thead>
<tbody>
<tr th:each="booking : ${bookingList}" th:object="${booking}">
<td th:text="*{hotel.name}">The Herb Plaza</td>
<td th:text="*{hotel.address}">Thyme Square, 13</td>
<td th:text="*{hotel.city} + ', ' + *{hotel.state}">Icetown, North Pole</td>
<td th:text="*{checkinDate}">2012-12-21</td>
<td th:text="*{checkoutDate}">2012-12-21</td>
<td th:text="*{id}">1</td>
<td>
<form action="#" th:action="@{'/bookings/' + *{id}}" th:method="'delete'">
<button type="submit">Cancel</button>
</form>
</td>
</tr>
</tbody>
</table>
</div>
</body>
<!-- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -->
<!-- END of the content to be included in the execution result -->
<!-- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -->
</html>

View File

@@ -1,53 +0,0 @@
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<%@ taglib prefix="security" uri="http://www.springframework.org/security/tags" %>
<%@ taglib prefix="spring" uri="http://www.springframework.org/tags" %>
<%@ taglib prefix="form" uri="http://www.springframework.org/tags/form" %>
<div id="bookings">
<security:authorize access="hasRole('ROLE_USER')">
<h2>Current Hotel Bookings</h2>
<c:if test="${empty bookingList}">
<tr>
<td colspan="7">No bookings found</td>
</tr>
</c:if>
<c:if test="${!empty bookingList}">
<table class="summary">
<thead>
<tr>
<th>Name</th>
<th>Address</th>
<th>City, State</th>
<th>Check in Date</th>
<th>Check out Date</th>
<th>Confirmation Number</th>
<th>Action</th>
</tr>
</thead>
<tbody>
<c:forEach var="booking" items="${bookingList}">
<tr>
<td>${booking.hotel.name}</td>
<td>${booking.hotel.address}</td>
<td>${booking.hotel.city}, ${booking.hotel.state}</td>
<td>${booking.checkinDate}</td>
<td>${booking.checkoutDate}</td>
<td>${booking.id}</td>
<td>
<spring:url var="bookingUrl" value="/bookings/{id}">
<spring:param name="id" value="${booking.id}"/>
</spring:url>
<form:form action="${bookingUrl}" method="delete">
<button type="submit">Cancel</button>
</form:form>
</td>
</tr>
</c:forEach>
</tbody>
</table>
</c:if>
</security:authorize>
</div>

View File

@@ -0,0 +1,139 @@
<!DOCTYPE html>
<html xmlns="http://www.w3.org/1999/xhtml"
xmlns:th="http://www.thymeleaf.org"
xmlns:tiles="http://www.thymeleaf.org"
xmlns:sec="http://www.thymeleaf.org"
lang="en">
<head>
<!-- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -->
<!-- This <head> section is only used for static prototyping purposes. At runtime, -->
<!-- Tiles will only use the body fragment defined with tiles:fragment="content", -->
<!-- as specified at the corresponding views.xml file. -->
<!-- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -->
<title>Spring Travel: Spring MVC and Web Flow Reference Application</title>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
<link rel="stylesheet" type="text/css" media="screen, projection"
href="../../styles/blueprint/screen.css" />
<link rel="stylesheet" type="text/css" media="print"
href="../../styles/blueprint/print.css" />
<!--[if lt IE 8]>
<link rel="stylesheet" type="text/css" media="screen, projection"
href="../../styles/blueprint/ie.css" />
<![endif]-->
<link rel="stylesheet" type="text/css" media="screen"
href="../../styles/booking.css" />
<!-- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -->
<!-- Some styles and scripts are served from spring-js-resources-{ver}.jar at -->
<!-- runtime. Therefore not available for static prototyping. See the -->
<!-- layouts/standard.html template file for detail. -->
<!-- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -->
</head>
<!-- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -->
<!-- START of the content to be included in the execution result. -->
<!-- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -->
<!-- Only the markup inside this <body> would be required in this -->
<!-- template if no static prototyping was intended. -->
<!-- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -->
<body tiles:fragment="content">
<h1>Hotel Results</h1>
<p>
<a id="changeSearchLink" href="#"
th:href="@{hotels/search(searchString=${searchCriteria.searchString},pageSize=${searchCriteria.pageSize})}">Change Search</a>
<script type="text/javascript">
// <![CDATA[
Spring.addDecoration(new Spring.AjaxEventDecoration({
elementId: "changeSearchLink",
event: "onclick",
popup: true,
params: {fragments: "searchForm"}
}));
// ]]>
</script>
</p>
<div id="hotelResults">
<div th:if="${hotelList}">
<table class="summary">
<thead>
<tr>
<th>Name</th>
<th>Address</th>
<th>City, State</th>
<th>Zip</th>
<th>Action</th>
</tr>
</thead>
<tbody>
<tr th:each="hotel : ${hotelList}">
<td th:text="${hotel.name}">The Herb Plaza</td>
<td th:text="${hotel.address}">Thyme Square, 13</td>
<td th:text="${hotel.city} + ', ' + ${hotel.state} + ', ' + ${hotel.country}">Icetown, North Pole, Earth</td>
<td th:text="${hotel.zip}">0W</td>
<td><a href="#" th:href="@{'hotels/' + ${hotel.id}}">View Hotel</a></td>
</tr>
<tr th:unless="${hotelList}">
<td colspan="5">No hotels found</td>
</tr>
</tbody>
</table>
<div class="buttonGroup">
<div class="span-3">
<div th:if="${searchCriteria.page > 0}">
<a id="prevResultsLink" href="#"
th:href="@{hotels(searchString=${searchCriteria.searchString},pageSize=${searchCriteria.pageSize},page=${searchCriteria.page - 1})}">Previous Results</a>
<script type="text/javascript">
// <![CDATA[
Spring.addDecoration(new Spring.AjaxEventDecoration({
elementId: "prevResultsLink",
event: "onclick",
params: {fragments: "body"}
}));
// ]]>
</script>
</div>
</div>
<div class="span-3 append-12 last">
<div th:if="${hotelList} and ${hotelList.size() == searchCriteria.pageSize}">
<a id="moreResultsLink" href="#"
th:href="@{hotels(searchString=${searchCriteria.searchString},pageSize=${searchCriteria.pageSize},page=${searchCriteria.page + 1})}">More Results</a>
<script type="text/javascript">
// <![CDATA[
Spring.addDecoration(new Spring.AjaxEventDecoration({
elementId: "moreResultsLink",
event: "onclick",
params: {fragments: "body"}
}));
// ]]>
</script>
</div>
</div>
</div>
</div>
</div>
</body>
<!-- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -->
<!-- END of the content to be included in the execution result -->
<!-- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -->
</html>

View File

@@ -1,74 +0,0 @@
<%@ taglib prefix="tiles" uri="http://tiles.apache.org/tags-tiles" %>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<%@ taglib prefix="fn" uri="http://java.sun.com/jsp/jstl/functions"%>
<h1>Hotel Results</h1>
<p>
<a id="changeSearchLink" href="hotels/search?searchString=${searchCriteria.searchString}&pageSize=${searchCriteria.pageSize}">Change Search</a>
<script type="text/javascript">
Spring.addDecoration(new Spring.AjaxEventDecoration({
elementId: "changeSearchLink",
event: "onclick",
popup: true,
params: {fragments: "searchForm"}
}));
</script>
</p>
<div id="hotelResults">
<c:if test="${not empty hotelList}">
<table class="summary">
<thead>
<tr>
<th>Name</th>
<th>Address</th>
<th>City, State</th>
<th>Zip</th>
<th>Action</th>
</tr>
</thead>
<tbody>
<c:forEach var="hotel" items="${hotelList}">
<tr>
<td>${hotel.name}</td>
<td>${hotel.address}</td>
<td>${hotel.city}, ${hotel.state}, ${hotel.country}</td>
<td>${hotel.zip}</td>
<td><a href="hotels/${hotel.id}">View Hotel</a></td>
</tr>
</c:forEach>
<c:if test="${empty hotelList}">
<tr>
<td colspan="5">No hotels found</td>
</tr>
</c:if>
</tbody>
</table>
<div class="buttonGroup">
<div class="span-3">
<c:if test="${searchCriteria.page > 0}">
<a id="prevResultsLink" href="hotels?searchString=${searchCriteria.searchString}&pageSize=${searchCriteria.pageSize}&page=${searchCriteria.page - 1}"><< Prev</a>
<script type="text/javascript">
Spring.addDecoration(new Spring.AjaxEventDecoration({
elementId: "prevResultsLink",
event: "onclick",
params: {fragments: "body"}
}));
</script>
</c:if>
</div>
<div class="span-3 append-12 last">
<c:if test="${not empty hotelList && fn:length(hotelList) == searchCriteria.pageSize}">
<a id="moreResultsLink" href="hotels?searchString=${searchCriteria.searchString}&pageSize=${searchCriteria.pageSize}&page=${searchCriteria.page + 1}">Next >></a>
<script type="text/javascript">
Spring.addDecoration(new Spring.AjaxEventDecoration({
elementId: "moreResultsLink",
event: "onclick",
params: {fragments: "body"}
}));
</script>
</c:if>
</div>
</div>
</c:if>
</div>

View File

@@ -0,0 +1,68 @@
<!DOCTYPE html>
<html xmlns="http://www.w3.org/1999/xhtml"
xmlns:th="http://www.thymeleaf.org"
xmlns:tiles="http://www.thymeleaf.org"
xmlns:sec="http://www.thymeleaf.org"
lang="en">
<head>
<!-- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -->
<!-- This <head> section is only used for static prototyping purposes. At runtime, -->
<!-- Tiles will only use the body fragment defined with tiles:fragment="content", -->
<!-- as specified at the corresponding views.xml file. -->
<!-- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -->
<title>Spring Travel: Spring MVC and Web Flow Reference Application</title>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
<link rel="stylesheet" type="text/css" media="screen, projection"
href="../../styles/blueprint/screen.css" />
<link rel="stylesheet" type="text/css" media="print"
href="../../styles/blueprint/print.css" />
<!--[if lt IE 8]>
<link rel="stylesheet" type="text/css" media="screen, projection"
href="../../styles/blueprint/ie.css" />
<![endif]-->
<link rel="stylesheet" type="text/css" media="screen"
href="../../styles/booking.css" />
<!-- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -->
<!-- Some styles and scripts are served from spring-js-resources-{ver}.jar at -->
<!-- runtime. Therefore not available for static prototyping. See the -->
<!-- layouts/standard.html template file for detail. -->
<!-- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -->
</head>
<!-- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -->
<!-- START of the content to be included in the execution result. -->
<!-- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -->
<!-- Only the markup inside this <body> would be required in this -->
<!-- template if no static prototyping was intended. -->
<!-- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -->
<body tiles:fragment="content">
<div tiles:include="searchForm">
A search form will go here. See it at <a href="searchForm.html">searchForm.html</a>.
</div>
<div tiles:include="bookingsTable">
A table with the current hotel bookings will go here.
See it at <a href="bookingsTable.html">bookingsTable.html</a>.
</div>
</body>
<!-- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -->
<!-- END of the content to be included in the execution result -->
<!-- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -->
</html>

View File

@@ -1,10 +0,0 @@
<%@ taglib prefix="tiles" uri="http://tiles.apache.org/tags-tiles" %>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<tiles:insertAttribute name="searchForm" />
<c:if test="${not empty confirmed}">
<div class="confirmed">${confirmed}</div>
</c:if>
<tiles:insertAttribute name="bookingsTable" />

View File

@@ -0,0 +1,95 @@
<!DOCTYPE html>
<html xmlns="http://www.w3.org/1999/xhtml"
xmlns:th="http://www.thymeleaf.org"
xmlns:tiles="http://www.thymeleaf.org"
xmlns:sec="http://www.thymeleaf.org"
lang="en">
<head>
<!-- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -->
<!-- This <head> section is only used for static prototyping purposes. At runtime, -->
<!-- Tiles will only use the body fragment defined with tiles:fragment="content", -->
<!-- as specified at the corresponding views.xml file. -->
<!-- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -->
<title>Spring Travel: Spring MVC and Web Flow Reference Application</title>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
<link rel="stylesheet" type="text/css" media="screen, projection"
href="../../styles/blueprint/screen.css" />
<link rel="stylesheet" type="text/css" media="print"
href="../../styles/blueprint/print.css" />
<!--[if lt IE 8]>
<link rel="stylesheet" type="text/css" media="screen, projection"
href="../../styles/blueprint/ie.css" />
<![endif]-->
<link rel="stylesheet" type="text/css" media="screen"
href="../../styles/booking.css" />
<!-- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -->
<!-- Some styles and scripts are served from spring-js-resources-{ver}.jar at -->
<!-- runtime. Therefore not available for static prototyping. See the -->
<!-- layouts/standard.html template file for detail. -->
<!-- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -->
</head>
<!-- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -->
<!-- START of the content to be included in the execution result. -->
<!-- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -->
<!-- Only the markup inside this <body> would be required in this -->
<!-- template if no static prototyping was intended. -->
<!-- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -->
<body tiles:fragment="content">
<h1>Search Hotels</h1>
<form action="#" th:object="${searchCriteria}" th:action="@{/hotels}" method="get" class="inline">
<ul th:if="${#fields.hasErrors('*')}" class="errors span-18">
<li th:each="err : ${#fields.errors('*')}" th:text="${err}">Input is incorrect</li>
</ul>
<fieldset>
<div class="span-8">
<label for="searchString">Search String:</label>
<input type="text" id="searchString" th:field="*{searchString}" />
<script type="text/javascript">
// <![CDATA[
Spring.addDecoration(new Spring.ElementDecoration({
elementId : "searchString",
widgetType : "dijit.form.ValidationTextBox",
widgetAttrs : { promptMessage : "Search hotels by name, address, city, or zip." }}));
// ]]>
</script>
</div>
<div class="span-6">
<div>
<label for="pageSize">Maximum results:</label>
<select id="pageSize" th:field="*{pageSize}">
<option label="5" value="5" />
<option label="10" value="10" />
<option label="20" value="20" />
</select>
</div>
</div>
<div class="span-3 last">
<button type="submit">Find Hotels</button>
</div>
</fieldset>
</form>
</body>
<!-- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -->
<!-- END of the content to be included in the execution result -->
<!-- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -->
</html>

View File

@@ -1,35 +0,0 @@
<%@ taglib prefix="form" uri="http://www.springframework.org/tags/form" %>
<%@ taglib prefix="c" uri="http://java.sun.com/jstl/core" %>
<h1>Search Hotels</h1>
<c:url var="hotelsUrl" value="/hotels"/>
<form:form modelAttribute="searchCriteria" action="${hotelsUrl}" method="get" cssClass="inline">
<span class="errors span-18">
<form:errors path="*"/>
</span>
<fieldset>
<div class="span-7">
<form:input id="searchString" path="searchString"/>
<script type="text/javascript">
Spring.addDecoration(new Spring.ElementDecoration({
elementId : "searchString",
widgetType : "dijit.form.ValidationTextBox",
widgetAttrs : { promptMessage : "Name, address, city, or zip." }}));
</script>
</div>
<div class="span-6">
<div>
<label for="pageSize">Page Size:</label>
<form:select id="pageSize" path="pageSize">
<form:option label="5" value="5"/>
<form:option label="10" value="10"/>
<form:option label="20" value="20"/>
</form:select>
</div>
</div>
<div class="span-3 last">
<button type="submit">Find Hotels</button>
</div>
</fieldset>
</form:form>

View File

@@ -0,0 +1,81 @@
<!DOCTYPE html>
<html xmlns="http://www.w3.org/1999/xhtml"
xmlns:th="http://www.thymeleaf.org"
xmlns:tiles="http://www.thymeleaf.org"
xmlns:sec="http://www.thymeleaf.org"
lang="en">
<head>
<!-- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -->
<!-- This <head> section is only used for static prototyping purposes. At runtime, -->
<!-- Tiles will only use the body fragment defined with tiles:fragment="content", -->
<!-- as specified at the corresponding views.xml file. -->
<!-- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -->
<title>Spring Travel: Spring MVC and Web Flow Reference Application</title>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
<link rel="stylesheet" type="text/css" media="screen, projection"
href="../../styles/blueprint/screen.css" />
<link rel="stylesheet" type="text/css" media="print"
href="../../styles/blueprint/print.css" />
<!--[if lt IE 8]>
<link rel="stylesheet" type="text/css" media="screen, projection"
href="../../styles/blueprint/ie.css" />
<![endif]-->
<link rel="stylesheet" type="text/css" media="screen"
href="../../styles/booking.css" />
<!-- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -->
<!-- Some styles and scripts are served from spring-js-resources-{ver}.jar at -->
<!-- runtime. Therefore not available for static prototyping. See the -->
<!-- layouts/standard.html template file for detail. -->
<!-- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -->
</head>
<!-- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -->
<!-- START of the content to be included in the execution result. -->
<!-- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -->
<!-- Only the markup inside this <body> would be required in this -->
<!-- template if no static prototyping was intended. -->
<!-- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -->
<body tiles:fragment="content">
<h1 th:text="${hotel.name}">The Herb Plaza</h1>
<address th:object="${hotel}">
<span th:text="*{address}">Thyme Square, 13</span>
<br />
<span th:text="*{city}">Icetown</span>,
<span th:text="*{state}">North Pole</span>,
<span th:text="*{zip}">0W</span>
<br />
<span th:text="*{country}">Earth</span>
</address>
<form action="#" th:action="@{/hotels/booking(mode='embedded')}" method="get">
<p>
Nightly Rate: <span th:text="${hotel.price}">4,300</span>
</p>
<input type="hidden" name="hotelId" th:value="${hotel.id}" />
<div>
<button type="submit">Book Hotel</button>
</div>
</form>
</body>
<!-- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -->
<!-- END of the content to be included in the execution result -->
<!-- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -->
</html>

View File

@@ -1,22 +0,0 @@
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<%@ taglib prefix="spring" uri="http://www.springframework.org/tags" %>
<%@ taglib prefix="form" uri="http://www.springframework.org/tags/form" %>
<h1>${hotel.name}</h1>
<address>
${hotel.address}
<br />
${hotel.city}, ${hotel.state}, ${hotel.zip}
<br />
${hotel.country}
</address>
<form action="booking?mode=embedded" method="get">
<p>
Nightly Rate:
<spring:bind path="hotel.price">${status.value}</spring:bind>
</p>
<input type="hidden" name="hotelId" value="${hotel.id}" />
<div>
<button type="submit">Book Hotel</button>
</div>
</form>

View File

@@ -7,15 +7,15 @@
<definition name="hotels/search" extends="standardLayout">
<put-attribute name="body">
<definition template="/WEB-INF/hotels/search.jsp">
<put-attribute name="searchForm" value="/WEB-INF/hotels/searchForm.jsp" />
<put-attribute name="bookingsTable" value="/WEB-INF/hotels/bookingsTable.jsp" />
<definition template="/hotels/search.html :: content" templateType="thymeleaf">
<put-attribute name="searchForm" value="/hotels/searchForm.html :: content" type="thymeleaf"/>
<put-attribute name="bookingsTable" value="/hotels/bookingsTable.html :: content" type="thymeleaf"/>
</definition>
</put-attribute>
</definition>
<definition name="hotels/*" extends="standardLayout">
<put-attribute name="body" value="/WEB-INF/hotels/{1}.jsp" />
<definition name="hotels/*" extends="standardLayout" templateType="thymeleaf">
<put-attribute name="body" value="/hotels/{1}.html :: content" type="thymeleaf"/>
</definition>
</tiles-definitions>

View File

@@ -0,0 +1,86 @@
<!DOCTYPE html>
<html xmlns="http://www.w3.org/1999/xhtml"
xmlns:th="http://www.thymeleaf.org"
xmlns:tiles="http://www.thymeleaf.org"
xmlns:sec="http://www.thymeleaf.org"
lang="en">
<head>
<!-- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -->
<!-- This <head> section is only used for static prototyping purposes. At runtime, -->
<!-- Tiles will only use the body fragment defined with tiles:fragment="content", -->
<!-- as specified at the corresponding views.xml file. -->
<!-- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -->
<title>Spring Travel: Spring MVC and Web Flow Reference Application</title>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
<link rel="stylesheet" type="text/css" media="screen, projection"
href="../styles/blueprint/screen.css" />
<link rel="stylesheet" type="text/css" media="print"
href="../styles/blueprint/print.css" />
<!--[if lt IE 8]>
<link rel="stylesheet" type="text/css" media="screen, projection"
href="../styles/blueprint/ie.css" />
<![endif]-->
<link rel="stylesheet" type="text/css" media="screen"
href="../styles/booking.css" />
<!-- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -->
<!-- Some styles and scripts are served from spring-js-resources-{ver}.jar at -->
<!-- runtime. Therefore not available for static prototyping. See the -->
<!-- layouts/standard.html template file for detail. -->
<!-- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -->
</head>
<!-- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -->
<!-- START of the content to be included in the execution result. -->
<!-- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -->
<!-- Only the markup inside this <body> would be required in this -->
<!-- template if no static prototyping was intended. -->
<!-- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -->
<body tiles:fragment="content">
<div>
<h1>Welcome to Spring Travel</h1>
<p>
This sample demonstrates how to use Spring MVC and Spring Web Flow together with Thymeleaf and Tiles.
</p>
<hr />
<p>
The key features illustrated in this sample include:
</p>
<ul>
<li>A declarative navigation model enabling full browser button support and dynamic navigation rules</li>
<li>A fine-grained state management model, including support for ConversationScope and ViewScope</li>
<li>Modularization of web application functionality by domain use case, illustrating project structure best-practices</li>
<li>Spring Expression Language (SpEL) integration</li>
<li>Spring 3 formatting annotations @DateTimeFormat, @NumberFormat</li>
<li>Spring MVC custom namespace</li>
<li>Spring Security integration</li>
<li>Annotated POJO @Controllers for implementing RESTful user interactions.</li>
<li>Declarative page authoring with Thymeleaf and its Spring MVC's integration features.</li>
<li>Page layout and composition with Apache Tiles</li>
<li>A JavaScript API for decorating HTML elements with behaviors such as Ajax, validation, and effects.</li>
<li>A grid layout with Blueprint CSS</li>
<li>Exception handling support across all layers of the application</li>
<li>SpringSource Tool Suite integration, with support for graphical flow modeling and visualization</li>
</ul>
<p>
<a href="hotels/search.html" th:href="@{/hotels/search}">Start your Spring Travel experience</a>
</p>
</div>
</body>
<!-- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -->
<!-- END of the content to be included in the execution result -->
<!-- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -->
</html>

View File

@@ -1,29 +0,0 @@
<div>
<h1>Welcome to Spring Travel</h1>
<p>
This sample demonstrates how to use Spring MVC and Spring Web Flow together with JavaServerPages (JSP) and Tiles.
</p>
<hr/>
<p>
The key features illustrated in this sample include:
</p>
<ul>
<li>A declarative navigation model enabling full browser button support and dynamic navigation rules</li>
<li>A fine-grained state management model, including support for ConversationScope and ViewScope</li>
<li>Modularization of web application functionality by domain use case, illustrating project structure best-practices</li>
<li>Spring Expression Language (SpEL) integration</li>
<li>Spring 3 formatting annotations @DateTimeFormat, @NumberFormat</li>
<li>Spring MVC custom namespace</li>
<li>Spring Security integration</li>
<li>Annotated POJO @Controllers for implementing RESTful user interactions.</li>
<li>Declarative page authoring with JSP, JSTL, and Spring MVC's form tag library</li>
<li>Page layout and composition with Apache Tiles</li>
<li>A JavaScript API for decorating HTML elements with behaviors such as Ajax, validation, and effects.</li>
<li>A grid layout with Blueprint CSS</li>
<li>Exception handling support across all layers of the application</li>
<li>SpringSource Tool Suite integration, with support for graphical flow modeling and visualization</li>
</ul>
<p>
<a href="hotels/search">Start your Spring Travel experience</a>
</p>
</div>

View File

@@ -0,0 +1,103 @@
<!DOCTYPE html>
<html xmlns="http://www.w3.org/1999/xhtml"
xmlns:th="http://www.thymeleaf.org"
xmlns:tiles="http://www.thymeleaf.org"
xmlns:sec="http://www.thymeleaf.org"
lang="en">
<head>
<title>Spring Travel: Spring MVC and Web Flow Reference Application</title>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
<link rel="stylesheet" type="text/css" media="screen, projection"
href="../../styles/blueprint/screen.css"
th:href="@{/resources/styles/blueprint/screen.css}" />
<link rel="stylesheet" type="text/css" media="print"
href="../../styles/blueprint/print.css"
th:href="@{/resources/styles/blueprint/print.css}" />
<!--[if lt IE 8]>
<link rel="stylesheet" type="text/css" media="screen, projection"
href="../../styles/blueprint/ie.css"
th:href="@{/resources/styles/blueprint/ie.css}" />
<![endif]-->
<link rel="stylesheet" type="text/css" media="screen"
href="../../styles/booking.css"
th:href="@{/resources/styles/booking.css}" />
<!-- The following styles and scripts are served from spring-js-resources-{ver}.jar -->
<link rel="stylesheet" type="text/css"
href="#" th:href="@{/resources/dijit/themes/tundra/tundra.css}" />
<script type="text/javascript" src="#" th:src="@{/resources/dojo/dojo.js}"></script>
<script type="text/javascript" src="#" th:src="@{/resources/spring/Spring.js}"></script>
<script type="text/javascript" src="#" th:src="@{/resources/spring/Spring-Dojo.js}"></script>
</head>
<body class="tundra">
<div id="page" class="container">
<div id="header">
<div id="topbar">
<p sec:authorize="hasRole('ROLE_USER')" th:if="${#authentication}">
Welcome, <span sec:authentication="name">Dear User</span> |
<a href="#" th:href="@{/logout}">Logout</a>
</p>
<p sec:authorize="hasRole('ROLE_ANONYMOUS')">
<a href="#" th:href="@{/login}">Login</a>
</p>
</div>
<div id="logo">
<p>
<a href="#" th:href="@{/}">
<img src="../../images/header.jpg" th:src="@{/resources/images/header.jpg}" alt="Spring Travel" />
</a>
</p>
</div>
</div>
<div id="content">
<div id="local" class="span-6">
<p>
<a href="http://www.thespringexperience.com">
<img src="../../images/diplomat.jpg" th:src="@{/resources/images/diplomat.jpg}" alt="generic hotel" />
</a>
</p>
<p>
<a href="http://www.thespringexperience.com">
<img src="../../images/springone2gx.jpeg" th:src="@{/resources/images/springone2gx.jpeg}" alt="SpringOne 2GX" />
</a>
</p>
</div>
<div id="main" class="span-18 last" tiles:include="body">
<!-- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -->
<!-- At runtime, the body of this <div> will be substituted by -->
<!-- Tiles in order to create the final HTML page that will be -->
<!-- sent to the browser. -->
<!-- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -->
BODY PAGE GOES HERE!
</div>
</div>
<hr />
<div id="footer">
<a href="http://www.springframework.org">
<img src="../../images/powered-by-spring.png" th:src="@{/resources/images/powered-by-spring.png}" alt="Powered by Spring" />
</a>
</div>
</div>
</body>
</html>

View File

@@ -1,74 +0,0 @@
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<%@ taglib prefix="tiles" uri="http://tiles.apache.org/tags-tiles" %>
<%@ taglib prefix="security" uri="http://www.springframework.org/security/tags" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "https://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
<title>Spring Travel: Spring MVC and Web Flow Reference Application</title>
<link type="text/css" rel="stylesheet" href="<c:url value="/resources/dijit/themes/tundra/tundra.css" />" />
<link rel="stylesheet" href="<c:url value="/resources/styles/blueprint/screen.css" />" type="text/css" media="screen, projection" />
<link rel="stylesheet" href="<c:url value="/resources/styles/blueprint/print.css" />" type="text/css" media="print" />
<!--[if lt IE 8]>
<link rel="stylesheet" href="<c:url value="/resources/blueprint/ie.css" />" type="text/css" media="screen, projection" />
<![endif]-->
<link rel="stylesheet" href="<c:url value="/resources/styles/booking.css" />" type="text/css" media="screen" />
<script type="text/javascript" src="<c:url value="/resources/dojo/dojo.js" />"></script>
<script type="text/javascript" src="<c:url value="/resources/spring/Spring.js" />"></script>
<script type="text/javascript" src="<c:url value="/resources/spring/Spring-Dojo.js" />"></script>
</head>
<body class="tundra">
<div id="page" class="container">
<div id="header">
<div id="topbar">
<security:authorize access="hasRole('ROLE_USER')">
<form action="<c:url value="/logout" />" method="post" class="inline">
<div class="span-4 label">
<c:if test="${pageContext.request.userPrincipal != null}">
Welcome, ${pageContext.request.userPrincipal.name}
</c:if>
</div>
<div class="last">
<input type="hidden" name="${_csrf.parameterName}" value="${_csrf.token}"/>
<button id="submit" type="submit">Logout</button>
</div>
</form>
</security:authorize>
<security:authorize access="hasRole('ROLE_ANONYMOUS')">
<a href="<c:url value="/login" />">Login</a>
</security:authorize>
</div>
<div id="logo">
<p>
<a href="<c:url value="/" />">
<img src="<c:url value="/resources/images/header.jpg"/>" alt="Spring Travel" />
</a>
</p>
</div>
</div>
<div id="content">
<div id="local" class="span-6">
<p>
<a href="https://www.thespringexperience.com">
<img src="<c:url value="/resources/images/diplomat.jpg"/>" alt="generic hotel" />
</a>
</p>
<p>
<a href="https://www.thespringexperience.com">
<img src="<c:url value="/resources/images/springone2gx.jpeg"/>" alt="SpringOne 2GX" />
</a>
</p>
</div>
<div id="main" class="span-18 last">
<tiles:insertAttribute name="body" />
</div>
</div>
<hr />
<div id="footer">
<a href="https://www.springframework.org">
<img src="<c:url value="/resources/images/powered-by-spring.png"/>" alt="Powered by Spring" />
</a>
</div>
</div>
</body>
</html>

View File

@@ -5,6 +5,7 @@
<tiles-definitions>
<definition name="standardLayout" template="/WEB-INF/layouts/standard.jsp" />
<definition name="standardLayout" template="/layouts/standard.html" templateType="thymeleaf"/>
<!-- <definition name="standardLayoutJSP" template="/WEB-INF/layouts/standard.jsp" templateType="jsp"/> -->
</tiles-definitions>

View File

@@ -0,0 +1,136 @@
<!DOCTYPE html>
<html xmlns="http://www.w3.org/1999/xhtml"
xmlns:th="http://www.thymeleaf.org"
xmlns:tiles="http://www.thymeleaf.org"
xmlns:sec="http://www.thymeleaf.org"
lang="en">
<head>
<!-- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -->
<!-- This <head> section is only used for static prototyping purposes. At runtime, -->
<!-- Tiles will only use the body fragment defined with tiles:fragment="content", -->
<!-- as specified at the corresponding views.xml file. -->
<!-- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -->
<title>Spring Travel: Spring MVC and Web Flow Reference Application</title>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
<link rel="stylesheet" type="text/css" media="screen, projection"
href="../styles/blueprint/screen.css" />
<link rel="stylesheet" type="text/css" media="print"
href="../styles/blueprint/print.css" />
<!--[if lt IE 8]>
<link rel="stylesheet" type="text/css" media="screen, projection"
href="../styles/blueprint/ie.css" />
<![endif]-->
<link rel="stylesheet" type="text/css" media="screen"
href="../styles/booking.css" />
<!-- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -->
<!-- Some styles and scripts are served from spring-js-resources-{ver}.jar at -->
<!-- runtime. Therefore not available for static prototyping. See the -->
<!-- layouts/standard.html template file for detail. -->
<!-- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -->
</head>
<!-- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -->
<!-- START of the content to be included in the execution result. -->
<!-- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -->
<!-- Only the markup inside this <body> would be required in this -->
<!-- template if no static prototyping was intended. -->
<!-- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -->
<body tiles:fragment="content">
<div class="span-5">
<p>Valid username/passwords are:</p>
<ul>
<li>keith/melbourne</li>
<li>erwin/leuven</li>
<li>jeremy/atlanta</li>
<li>scott/rochester</li>
</ul>
</div>
<div class="span-10 append-2 last" xmlns:th="http://www.thymeleaf.org">
<div class="error" th:if="${param.login_error}">
Your login attempt was not successful, try again.<br /><br />
</div>
<form name="f" action="#" th:action="@{/loginProcess}" method="post">
<fieldset>
<legend>Login Information</legend>
<p>
<label for="username">User:</label>
<br />
<input type="text" name="username" id="username" />
</p>
<script type="text/javascript">
// <![CDATA[
Spring.addDecoration(new Spring.ElementDecoration({
elementId : "username",
widgetType : "dijit.form.ValidationTextBox",
widgetAttrs : { required : true }}));
// ]]>
</script>
<p>
<label for="password">Password:</label>
<br />
<input type="password" name="password" id="password" />
</p>
<script type="text/javascript">
// <![CDATA[
Spring.addDecoration(new Spring.ElementDecoration({
elementId : "password",
widgetType : "dijit.form.ValidationTextBox",
widgetAttrs : { required : true}}));
// ]]>
</script>
<p>
<input type="checkbox" name="_spring_security_remember_me" id="remember_me" />
<label for="remember_me">Don't ask for my password for two weeks:</label>
</p>
<script type="text/javascript">
// <![CDATA[
Spring.addDecoration(new Spring.ElementDecoration({
elementId : "remember_me",
widgetType : "dijit.form.CheckBox"}));
// ]]>
</script>
<p>
<button id="submit" type="submit">Login</button>
<script type="text/javascript">
Spring.addDecoration(
new Spring.ValidateAllDecoration({event : 'onclick', elementId : 'submit'}));
</script>
</p>
</fieldset>
</form>
</div>
</body>
<!-- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -->
<!-- END of the content to be included in the execution result -->
<!-- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -->
</html>

View File

@@ -1,65 +0,0 @@
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<%@ taglib prefix="form" uri="http://www.springframework.org/tags/form" %>
<div class="span-5">
<p>Valid username/passwords are:</p>
<ul>
<li>keith/melbourne</li>
<li>erwin/leuven</li>
<li>jeremy/atlanta</li>
<li>scott/rochester</li>
</ul>
</div>
<div class="span-10 append-2 last">
<c:if test="${not empty param.login_error}">
<div class="error">
Your login attempt was not successful, try again.
</div>
</c:if>
<form name="f" action="<c:url value="/loginProcess" />" method="post">
<fieldset>
<legend>Login Information</legend>
<p>
<label for="username">User:</label>
<br />
<input type="text" name="username" id="username" />
</p>
<script type="text/javascript">
Spring.addDecoration(new Spring.ElementDecoration({
elementId : "username",
widgetType : "dijit.form.ValidationTextBox",
widgetAttrs : { required : true }}));
</script>
<p>
<label for="password">Password:</label>
<br />
<input type="password" name="password" id="password" />
</p>
<script type="text/javascript">
Spring.addDecoration(new Spring.ElementDecoration({
elementId : "password",
widgetType : "dijit.form.ValidationTextBox",
widgetAttrs : { required : true}}));
</script>
<p>
<input type="checkbox" name="_spring_security_remember_me" id="remember_me" />
<label for="remember_me">Don't ask for my password for two weeks:</label>
</p>
<script type="text/javascript">
Spring.addDecoration(new Spring.ElementDecoration({
elementId : "remember_me",
widgetType : "dijit.form.CheckBox"}));
</script>
<div>
<input type="hidden" name="${_csrf.parameterName}" value="${_csrf.token}"/>
</div>
<p>
<button id="submit" type="submit">Login</button>
<script type="text/javascript">
Spring.addDecoration(new Spring.ValidateAllDecoration({event : 'onclick', elementId : 'submit'}));
</script>
</p>
</fieldset>
</form>
</div>

View File

@@ -0,0 +1,64 @@
<!DOCTYPE html>
<html xmlns="http://www.w3.org/1999/xhtml"
xmlns:th="http://www.thymeleaf.org"
xmlns:tiles="http://www.thymeleaf.org"
xmlns:sec="http://www.thymeleaf.org"
lang="en">
<head>
<!-- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -->
<!-- This <head> section is only used for static prototyping purposes. At runtime, -->
<!-- Tiles will only use the body fragment defined with tiles:fragment="content", -->
<!-- as specified at the corresponding views.xml file. -->
<!-- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -->
<title>Spring Travel: Spring MVC and Web Flow Reference Application</title>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
<link rel="stylesheet" type="text/css" media="screen, projection"
href="../styles/blueprint/screen.css" />
<link rel="stylesheet" type="text/css" media="print"
href="../styles/blueprint/print.css" />
<!--[if lt IE 8]>
<link rel="stylesheet" type="text/css" media="screen, projection"
href="../styles/blueprint/ie.css" />
<![endif]-->
<link rel="stylesheet" type="text/css" media="screen"
href="../styles/booking.css" />
<!-- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -->
<!-- Some styles and scripts are served from spring-js-resources-{ver}.jar at -->
<!-- runtime. Therefore not available for static prototyping. See the -->
<!-- layouts/standard.html template file for detail. -->
<!-- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -->
</head>
<!-- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -->
<!-- START of the content to be included in the execution result. -->
<!-- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -->
<!-- Only the markup inside this <body> would be required in this -->
<!-- template if no static prototyping was intended. -->
<!-- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -->
<body tiles:fragment="content">
<div>
<h1>Logout</h1>
<p>You have successfully logged out.</p>
<hr />
<p><a href="hotels/searchForm.html" th:href="@{/hotels/search}">Continue</a></p>
</div>
</body>
<!-- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -->
<!-- END of the content to be included in the execution result -->
<!-- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -->
</html>

View File

@@ -1,8 +0,0 @@
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<div>
<h1>Logout</h1>
<p>You have successfully logged out.</p>
<hr />
<p><a href="<c:url value="hotels/search" />">Continue</a></p>
</div>

View File

@@ -6,15 +6,15 @@
<tiles-definitions>
<definition name="intro" extends="standardLayout">
<put-attribute name="body" value="/WEB-INF/intro.jsp" />
<put-attribute name="body" value="/intro.html :: content" type="thymeleaf"/>
</definition>
<definition name="login" extends="standardLayout">
<put-attribute name="body" value="/WEB-INF/login.jsp" />
<put-attribute name="body" value="/login.html :: content" type="thymeleaf"/>
</definition>
<definition name="logoutSuccess" extends="standardLayout">
<put-attribute name="body" value="/WEB-INF/logoutSuccess.jsp" />
<put-attribute name="body" value="/logoutSuccess.html :: content" type="thymeleaf"/>
</definition>
</tiles-definitions>