Replace Tiles with Thymeleaf layout

This commit is contained in:
rstoyanchev
2022-07-18 09:31:19 +01:00
parent 6b958aad1e
commit 91a1866e61
23 changed files with 180 additions and 480 deletions

View File

@@ -72,7 +72,7 @@
<dependency> <dependency>
<groupId>org.thymeleaf</groupId> <groupId>org.thymeleaf</groupId>
<artifactId>thymeleaf</artifactId> <artifactId>thymeleaf</artifactId>
<version>2.1.5.RELEASE</version> <version>3.1.0.M1</version>
</dependency> </dependency>
<dependency> <dependency>
<groupId>org.thymeleaf</groupId> <groupId>org.thymeleaf</groupId>

View File

@@ -21,7 +21,7 @@ public class HotelsController {
} }
@GetMapping("/hotels/search") @GetMapping("/hotels/search")
public void search(SearchCriteria searchCriteria, Principal currentUser, Model model) { public void search(@SuppressWarnings("unused") SearchCriteria searchCriteria, Principal currentUser, Model model) {
if (currentUser != null) { if (currentUser != null) {
List<Booking> booking = bookingService.findBookings(currentUser.getName()); List<Booking> booking = bookingService.findBookings(currentUser.getName());
model.addAttribute(booking); model.addAttribute(booking);

View File

@@ -5,6 +5,7 @@ import org.springframework.security.config.annotation.authentication.builders.Au
import org.springframework.security.config.annotation.web.builders.HttpSecurity; import org.springframework.security.config.annotation.web.builders.HttpSecurity;
import org.springframework.security.config.annotation.web.configuration.EnableWebSecurity; import org.springframework.security.config.annotation.web.configuration.EnableWebSecurity;
import org.springframework.security.config.annotation.web.configuration.WebSecurityConfigurerAdapter; import org.springframework.security.config.annotation.web.configuration.WebSecurityConfigurerAdapter;
import org.springframework.security.web.util.matcher.AntPathRequestMatcher;
@Configuration @Configuration
@EnableWebSecurity @EnableWebSecurity
@@ -20,7 +21,7 @@ public class SecurityConfig extends WebSecurityConfigurerAdapter {
.failureUrl("/login?login_error=1") .failureUrl("/login?login_error=1")
.and() .and()
.logout() .logout()
.logoutUrl("/logout") .logoutRequestMatcher(new AntPathRequestMatcher("/logout", "GET"))
.logoutSuccessUrl("/logoutSuccess"); .logoutSuccessUrl("/logoutSuccess");
} }

View File

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

View File

@@ -3,34 +3,43 @@ package org.springframework.webflow.samples.booking.config;
import java.util.LinkedHashSet; import java.util.LinkedHashSet;
import java.util.Set; import java.util.Set;
import jakarta.servlet.ServletContext;
import org.thymeleaf.dialect.IDialect;
import org.thymeleaf.extras.springsecurity6.dialect.SpringSecurityDialect;
import org.thymeleaf.spring6.SpringTemplateEngine;
import org.thymeleaf.spring6.view.AjaxThymeleafViewResolver;
import org.thymeleaf.spring6.view.FlowAjaxThymeleafView;
import org.thymeleaf.templateresolver.WebApplicationTemplateResolver;
import org.thymeleaf.web.IWebApplication;
import org.thymeleaf.web.servlet.JakartaServletWebApplication;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.context.annotation.Bean; import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration; import org.springframework.context.annotation.Configuration;
import org.springframework.web.context.ServletContextAware;
import org.springframework.web.servlet.config.annotation.DefaultServletHandlerConfigurer; import org.springframework.web.servlet.config.annotation.DefaultServletHandlerConfigurer;
import org.springframework.web.servlet.config.annotation.EnableWebMvc; import org.springframework.web.servlet.config.annotation.EnableWebMvc;
import org.springframework.web.servlet.config.annotation.ResourceHandlerRegistry; import org.springframework.web.servlet.config.annotation.ResourceHandlerRegistry;
import org.springframework.web.servlet.config.annotation.ViewControllerRegistry; import org.springframework.web.servlet.config.annotation.ViewControllerRegistry;
import org.springframework.web.servlet.config.annotation.WebMvcConfigurerAdapter; import org.springframework.web.servlet.config.annotation.WebMvcConfigurer;
import org.springframework.webflow.mvc.servlet.FlowHandlerAdapter; import org.springframework.webflow.mvc.servlet.FlowHandlerAdapter;
import org.springframework.webflow.mvc.servlet.FlowHandlerMapping; import org.springframework.webflow.mvc.servlet.FlowHandlerMapping;
import org.springframework.webflow.samples.booking.BookingFlowHandler; 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 @EnableWebMvc
@Configuration @Configuration
public class WebMvcConfig extends WebMvcConfigurerAdapter { public class WebMvcConfig implements WebMvcConfigurer, ServletContextAware {
@Autowired @Autowired
private WebFlowConfig webFlowConfig; private WebFlowConfig webFlowConfig;
private ServletContext servletContext;
@Override
public void setServletContext(ServletContext servletContext) {
this.servletContext = servletContext;
}
@Override @Override
public void addResourceHandlers(ResourceHandlerRegistry registry) { public void addResourceHandlers(ResourceHandlerRegistry registry) {
registry.addResourceHandler("/resources/**").addResourceLocations("/", "classpath:/META-INF/web-resources/"); registry.addResourceHandler("/resources/**").addResourceLocations("/", "classpath:/META-INF/web-resources/");
@@ -70,9 +79,9 @@ public class WebMvcConfig extends WebMvcConfigurerAdapter {
} }
@Bean @Bean
public AjaxThymeleafViewResolver tilesViewResolver() { public AjaxThymeleafViewResolver thymeleafViewResolver() {
AjaxThymeleafViewResolver viewResolver = new AjaxThymeleafViewResolver(); AjaxThymeleafViewResolver viewResolver = new AjaxThymeleafViewResolver();
viewResolver.setViewClass(FlowAjaxThymeleafTilesView.class); viewResolver.setViewClass(FlowAjaxThymeleafView.class);
viewResolver.setTemplateEngine(templateEngine()); viewResolver.setTemplateEngine(templateEngine());
return viewResolver; return viewResolver;
} }
@@ -80,10 +89,8 @@ public class WebMvcConfig extends WebMvcConfigurerAdapter {
@Bean @Bean
public SpringTemplateEngine templateEngine(){ public SpringTemplateEngine templateEngine(){
Set<IDialect> dialects = new LinkedHashSet<IDialect>(); Set<IDialect> dialects = new LinkedHashSet<>();
dialects.add(new TilesDialect());
dialects.add(new SpringSecurityDialect()); dialects.add(new SpringSecurityDialect());
dialects.add(new ConditionalCommentsDialect());
SpringTemplateEngine templateEngine = new SpringTemplateEngine(); SpringTemplateEngine templateEngine = new SpringTemplateEngine();
templateEngine.setTemplateResolver(templateResolver()); templateEngine.setTemplateResolver(templateResolver());
@@ -92,18 +99,13 @@ public class WebMvcConfig extends WebMvcConfigurerAdapter {
} }
@Bean @Bean
public ServletContextTemplateResolver templateResolver() { public WebApplicationTemplateResolver templateResolver() {
ServletContextTemplateResolver templateResolver = new ServletContextTemplateResolver(); IWebApplication application = JakartaServletWebApplication.buildApplication(this.servletContext);
templateResolver.setPrefix("/WEB-INF"); WebApplicationTemplateResolver resolver = new WebApplicationTemplateResolver(application);
templateResolver.setTemplateMode("HTML5"); resolver.setPrefix("/WEB-INF/");
return templateResolver; resolver.setSuffix(".html");
} resolver.setTemplateMode("HTML5");
return resolver;
@Bean
public ThymeleafTilesConfigurer tilesConfigurer() {
ThymeleafTilesConfigurer configurer = new ThymeleafTilesConfigurer();
configurer.setDefinitions("/WEB-INF/**/views.xml");
return configurer;
} }
} }

View File

@@ -8,6 +8,7 @@
<Loggers> <Loggers>
<Logger name="org.springframework.samples" level="debug" /> <Logger name="org.springframework.samples" level="debug" />
<Logger name="org.springframework.web" level="debug" /> <Logger name="org.springframework.web" level="debug" />
<Logger name="org.thymeleaf.spring6" level="debug" />
<Root level="info"> <Root level="info">
<AppenderRef ref="Console" /> <AppenderRef ref="Console" />
</Root> </Root>

View File

@@ -13,7 +13,7 @@
<evaluate expression="bookingService.createBooking(hotelId, currentUser.name)" result="flowScope.booking" /> <evaluate expression="bookingService.createBooking(hotelId, currentUser.name)" result="flowScope.booking" />
</on-start> </on-start>
<view-state id="enterBookingDetails" model="booking"> <view-state id="enterBookingDetails" model="booking" view="/hotels/booking/enterBookingDetails.html">
<binder> <binder>
<binding property="checkinDate" /> <binding property="checkinDate" />
<binding property="checkoutDate" /> <binding property="checkoutDate" />
@@ -32,7 +32,7 @@
<transition on="cancel" to="cancel" bind="false" /> <transition on="cancel" to="cancel" bind="false" />
</view-state> </view-state>
<view-state id="reviewBooking"> <view-state id="reviewBooking" view="/hotels/booking/reviewBooking.html">
<on-render> <on-render>
<render fragments="body" /> <render fragments="body" />
</on-render> </on-render>

View File

@@ -1,55 +1,36 @@
<!DOCTYPE html> <!DOCTYPE html>
<html xmlns="http://www.w3.org/1999/xhtml" <html xmlns="http://www.w3.org/1999/xhtml"
xmlns:th="http://www.thymeleaf.org" xmlns:th="http://www.thymeleaf.org"
xmlns:tiles="http://www.thymeleaf.org"
xmlns:sec="http://www.thymeleaf.org"
lang="en"> lang="en">
<head> <head th:replace="layouts/standard.html :: //head">
<!-- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - --> <!-- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -->
<!-- This <head> section is only used for static prototyping purposes. At runtime, --> <!-- This <head> section is only used for static prototyping purposes. -->
<!-- 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> <title>Spring Travel: Spring MVC and Web Flow Reference Application</title>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" /> <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" />
<link rel="stylesheet" type="text/css" media="screen, projection"
<!-- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - --> href="../../../styles/blueprint/screen.css" />
<!-- Some styles and scripts are served from spring-js-resources-{ver}.jar at -->
<!-- runtime. Therefore not available for static prototyping. See the --> <link rel="stylesheet" type="text/css" media="print"
<!-- layouts/standard.html template file for detail. --> 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" />
</head> </head>
<!-- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - --> <body th:replace="layouts/standard.html :: body(~{::bodyContent})">
<!-- 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 th:fragment="bodyContent">
<div id="bookingForm">
<div class="span-5"> <div class="span-5">

View File

@@ -1,53 +1,33 @@
<!DOCTYPE html> <!DOCTYPE html>
<html xmlns="http://www.w3.org/1999/xhtml" <html xmlns="http://www.w3.org/1999/xhtml"
xmlns:th="http://www.thymeleaf.org" xmlns:th="http://www.thymeleaf.org"
xmlns:tiles="http://www.thymeleaf.org"
xmlns:sec="http://www.thymeleaf.org"
lang="en"> lang="en">
<head> <head th:replace="layouts/standard.html :: //head">
<!-- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - --> <!-- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -->
<!-- This <head> section is only used for static prototyping purposes. At runtime, --> <!-- This <head> section is only used for static prototyping purposes. -->
<!-- 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> <title>Spring Travel: Spring MVC and Web Flow Reference Application</title>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" /> <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" />
<link rel="stylesheet" type="text/css" media="screen, projection"
<!-- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - --> href="../../../styles/blueprint/screen.css" />
<!-- Some styles and scripts are served from spring-js-resources-{ver}.jar at -->
<!-- runtime. Therefore not available for static prototyping. See the --> <link rel="stylesheet" type="text/css" media="print"
<!-- layouts/standard.html template file for detail. --> 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" />
</head> </head>
<!-- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - --> <body th:replace="layouts/standard.html :: body(~{::#messages})">
<!-- 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"> <div id="messages">
@@ -58,8 +38,5 @@
</body> </body>
<!-- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -->
<!-- END of the content to be included in the execution result -->
<!-- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -->
</html> </html>

View File

@@ -1,55 +1,35 @@
<!DOCTYPE html> <!DOCTYPE html>
<html xmlns="http://www.w3.org/1999/xhtml" <html xmlns="http://www.w3.org/1999/xhtml"
xmlns:th="http://www.thymeleaf.org" xmlns:th="http://www.thymeleaf.org"
xmlns:tiles="http://www.thymeleaf.org"
xmlns:sec="http://www.thymeleaf.org"
lang="en"> lang="en">
<head> <head th:replace="layouts/standard.html :: //head">
<!-- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - --> <!-- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -->
<!-- This <head> section is only used for static prototyping purposes. At runtime, --> <!-- This <head> section is only used for static prototyping purposes. -->
<!-- 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> <title>Spring Travel: Spring MVC and Web Flow Reference Application</title>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" /> <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" />
<link rel="stylesheet" type="text/css" media="screen, projection"
<!-- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - --> href="../../../styles/blueprint/screen.css" />
<!-- Some styles and scripts are served from spring-js-resources-{ver}.jar at -->
<!-- runtime. Therefore not available for static prototyping. See the --> <link rel="stylesheet" type="text/css" media="print"
<!-- layouts/standard.html template file for detail. --> 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" />
</head> </head>
<!-- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - --> <body th:replace="layouts/standard.html :: body(~{::bodyContent})">
<!-- 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 th:fragment="bodyContent">
<div id="bookingForm">
<div class="span-5"> <div class="span-5">
@@ -126,10 +106,6 @@
</div> </div>
</body> </body>
<!-- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -->
<!-- END of the content to be included in the execution result -->
<!-- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -->
</html> </html>

View File

@@ -1,16 +0,0 @@
<?xml version="1.0" encoding="UTF-8"?>
<!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" templateType="thymeleaf">
<put-attribute name="body" value="/hotels/booking/enterBookingDetails.html :: content" type="thymeleaf"/>
</definition>
<definition name="reviewBooking" extends="standardLayout" templateType="thymeleaf">
<put-attribute name="body" value="/hotels/booking/reviewBooking.html :: content" type="thymeleaf"/>
</definition>
</tiles-definitions>

View File

@@ -1,16 +1,13 @@
<!DOCTYPE html> <!DOCTYPE html>
<html xmlns="http://www.w3.org/1999/xhtml" <html xmlns="http://www.w3.org/1999/xhtml"
xmlns:th="http://www.thymeleaf.org" xmlns:th="http://www.thymeleaf.org"
xmlns:tiles="http://www.thymeleaf.org"
xmlns:sec="http://www.thymeleaf.org" xmlns:sec="http://www.thymeleaf.org"
lang="en"> lang="en">
<head> <head th:replace="layouts/standard.html :: //head">
<!-- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - --> <!-- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -->
<!-- This <head> section is only used for static prototyping purposes. At runtime, --> <!-- This <head> section is only used for static prototyping purposes. -->
<!-- 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> <title>Spring Travel: Spring MVC and Web Flow Reference Application</title>
@@ -26,29 +23,15 @@
<link rel="stylesheet" type="text/css" media="screen, projection" <link rel="stylesheet" type="text/css" media="screen, projection"
href="../../styles/blueprint/ie.css" /> href="../../styles/blueprint/ie.css" />
<![endif]--> <![endif]-->
<link rel="stylesheet" type="text/css" media="screen"
href="../../styles/booking.css" />
<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> </head>
<!-- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - --> <body th:replace="layouts/standard.html :: body(~{::bodyContent})">
<!-- 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')"> <div th:fragment="bodyContent" sec:authorize="hasRole('ROLE_USER')">
<h2>Current Hotel Bookings</h2> <h2>Current Hotel Bookings</h2>
@@ -87,10 +70,6 @@
</div> </div>
</body> </body>
<!-- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -->
<!-- END of the content to be included in the execution result -->
<!-- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -->
</html> </html>

View File

@@ -1,16 +1,12 @@
<!DOCTYPE html> <!DOCTYPE html>
<html xmlns="http://www.w3.org/1999/xhtml" <html xmlns="http://www.w3.org/1999/xhtml"
xmlns:th="http://www.thymeleaf.org" xmlns:th="http://www.thymeleaf.org"
xmlns:tiles="http://www.thymeleaf.org"
xmlns:sec="http://www.thymeleaf.org"
lang="en"> lang="en">
<head> <head th:replace="layouts/standard.html :: //head">
<!-- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - --> <!-- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -->
<!-- This <head> section is only used for static prototyping purposes. At runtime, --> <!-- This <head> section is only used for static prototyping purposes. -->
<!-- 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> <title>Spring Travel: Spring MVC and Web Flow Reference Application</title>
@@ -26,28 +22,14 @@
<link rel="stylesheet" type="text/css" media="screen, projection" <link rel="stylesheet" type="text/css" media="screen, projection"
href="../../styles/blueprint/ie.css" /> href="../../styles/blueprint/ie.css" />
<![endif]--> <![endif]-->
<link rel="stylesheet" type="text/css" media="screen"
href="../../styles/booking.css" />
<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> </head>
<!-- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - --> <body th:replace="layouts/standard.html :: body(~{::bodyContent})">
<!-- 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 th:fragment="bodyContent">
<h1>Hotel Results</h1> <h1>Hotel Results</h1>
@@ -55,14 +37,12 @@
<a id="changeSearchLink" href="#" <a id="changeSearchLink" href="#"
th:href="@{hotels/search(searchString=${searchCriteria.searchString},pageSize=${searchCriteria.pageSize})}">Change Search</a> th:href="@{hotels/search(searchString=${searchCriteria.searchString},pageSize=${searchCriteria.pageSize})}">Change Search</a>
<script type="text/javascript"> <script type="text/javascript">
// <![CDATA[
Spring.addDecoration(new Spring.AjaxEventDecoration({ Spring.addDecoration(new Spring.AjaxEventDecoration({
elementId: "changeSearchLink", elementId: "changeSearchLink",
event: "onclick", event: "onclick",
popup: true, popup: true,
params: {fragments: "searchForm"} params: {fragments: "#searchForm"}
})); }));
// ]]>
</script> </script>
</p> </p>
@@ -100,13 +80,11 @@
<a id="prevResultsLink" href="#" <a id="prevResultsLink" href="#"
th:href="@{hotels(searchString=${searchCriteria.searchString},pageSize=${searchCriteria.pageSize},page=${searchCriteria.page - 1})}">Previous Results</a> th:href="@{hotels(searchString=${searchCriteria.searchString},pageSize=${searchCriteria.pageSize},page=${searchCriteria.page - 1})}">Previous Results</a>
<script type="text/javascript"> <script type="text/javascript">
// <![CDATA[
Spring.addDecoration(new Spring.AjaxEventDecoration({ Spring.addDecoration(new Spring.AjaxEventDecoration({
elementId: "prevResultsLink", elementId: "prevResultsLink",
event: "onclick", event: "onclick",
params: {fragments: "body"} params: {fragments: "#hotelResults"}
})); }));
// ]]>
</script> </script>
</div> </div>
</div> </div>
@@ -115,13 +93,11 @@
<a id="moreResultsLink" href="#" <a id="moreResultsLink" href="#"
th:href="@{hotels(searchString=${searchCriteria.searchString},pageSize=${searchCriteria.pageSize},page=${searchCriteria.page + 1})}">More Results</a> th:href="@{hotels(searchString=${searchCriteria.searchString},pageSize=${searchCriteria.pageSize},page=${searchCriteria.page + 1})}">More Results</a>
<script type="text/javascript"> <script type="text/javascript">
// <![CDATA[
Spring.addDecoration(new Spring.AjaxEventDecoration({ Spring.addDecoration(new Spring.AjaxEventDecoration({
elementId: "moreResultsLink", elementId: "moreResultsLink",
event: "onclick", event: "onclick",
params: {fragments: "body"} params: {fragments: "#hotelResults"}
})); }));
// ]]>
</script> </script>
</div> </div>
</div> </div>
@@ -130,10 +106,8 @@
</div> </div>
</div>
</body> </body>
<!-- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -->
<!-- END of the content to be included in the execution result -->
<!-- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -->
</html> </html>

View File

@@ -1,16 +1,12 @@
<!DOCTYPE html> <!DOCTYPE html>
<html xmlns="http://www.w3.org/1999/xhtml" <html xmlns="http://www.w3.org/1999/xhtml"
xmlns:th="http://www.thymeleaf.org" xmlns:th="http://www.thymeleaf.org"
xmlns:tiles="http://www.thymeleaf.org"
xmlns:sec="http://www.thymeleaf.org"
lang="en"> lang="en">
<head> <head th:replace="layouts/standard.html :: //head">
<!-- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - --> <!-- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -->
<!-- This <head> section is only used for static prototyping purposes. At runtime, --> <!-- This <head> section is only used for static prototyping purposes. -->
<!-- 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> <title>Spring Travel: Spring MVC and Web Flow Reference Application</title>
@@ -27,42 +23,25 @@
href="../../styles/blueprint/ie.css" /> href="../../styles/blueprint/ie.css" />
<![endif]--> <![endif]-->
<link rel="stylesheet" type="text/css" media="screen" <link rel="stylesheet" type="text/css" media="screen" href="../../styles/booking.css" />
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> </head>
<!-- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - --> <body th:replace="layouts/standard.html :: body(~{::bodyContent})">
<!-- 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 th:fragment="bodyContent">
<div id="searchForm" th:replace="hotels/searchForm.html :: bodyContent">
<div tiles:include="searchForm">
A search form will go here. See it at <a href="searchForm.html">searchForm.html</a>. A search form will go here. See it at <a href="searchForm.html">searchForm.html</a>.
</div> </div>
<div tiles:include="bookingsTable"> <div th:replace="hotels/bookingsTable.html :: bodyContent">
A table with the current hotel bookings will go here. A table with the current hotel bookings will go here.
See it at <a href="bookingsTable.html">bookingsTable.html</a>. See it at <a href="bookingsTable.html">bookingsTable.html</a>.
</div> </div>
</div>
</body> </body>
<!-- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -->
<!-- END of the content to be included in the execution result -->
<!-- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -->
</html> </html>

View File

@@ -5,12 +5,10 @@
xmlns:sec="http://www.thymeleaf.org" xmlns:sec="http://www.thymeleaf.org"
lang="en"> lang="en">
<head> <head th:replace="layouts/standard.html :: //head">
<!-- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - --> <!-- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -->
<!-- This <head> section is only used for static prototyping purposes. At runtime, --> <!-- This <head> section is only used for static prototyping purposes. -->
<!-- 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> <title>Spring Travel: Spring MVC and Web Flow Reference Application</title>
@@ -26,27 +24,14 @@
<link rel="stylesheet" type="text/css" media="screen, projection" <link rel="stylesheet" type="text/css" media="screen, projection"
href="../../styles/blueprint/ie.css" /> href="../../styles/blueprint/ie.css" />
<![endif]--> <![endif]-->
<link rel="stylesheet" type="text/css" media="screen"
href="../../styles/booking.css" />
<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> </head>
<!-- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - --> <body th:replace="layouts/standard.html :: body(~{::bodyContent})">
<!-- 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 th:fragment="bodyContent">
<h1>Search Hotels</h1> <h1>Search Hotels</h1>
@@ -86,10 +71,8 @@
</form> </form>
</div>
</body> </body>
<!-- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -->
<!-- END of the content to be included in the execution result -->
<!-- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -->
</html> </html>

View File

@@ -5,49 +5,33 @@
xmlns:sec="http://www.thymeleaf.org" xmlns:sec="http://www.thymeleaf.org"
lang="en"> lang="en">
<head> <head th:replace="layouts/standard.html :: //head">
<!-- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - --> <!-- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -->
<!-- This <head> section is only used for static prototyping purposes. At runtime, --> <!-- This <head> section is only used for static prototyping purposes. -->
<!-- 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> <title>Spring Travel: Spring MVC and Web Flow Reference Application</title>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" /> <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" />
<link rel="stylesheet" type="text/css" media="screen, projection"
<!-- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - --> href="../../styles/blueprint/screen.css" />
<!-- Some styles and scripts are served from spring-js-resources-{ver}.jar at -->
<!-- runtime. Therefore not available for static prototyping. See the --> <link rel="stylesheet" type="text/css" media="print"
<!-- layouts/standard.html template file for detail. --> 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" />
</head> </head>
<!-- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - --> <body th:replace="layouts/standard.html :: body(~{::bodyContent})">
<!-- 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 th:fragment="bodyContent">
<h1 th:text="${hotel.name}">The Herb Plaza</h1> <h1 th:text="${hotel.name}">The Herb Plaza</h1>
@@ -71,11 +55,8 @@
</div> </div>
</form> </form>
</div>
</body> </body>
<!-- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -->
<!-- END of the content to be included in the execution result -->
<!-- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -->
</html> </html>

View File

@@ -1,21 +0,0 @@
<?xml version="1.0" encoding="UTF-8"?>
<!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="hotels/search" extends="standardLayout">
<put-attribute name="body">
<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" templateType="thymeleaf">
<put-attribute name="body" value="/hotels/{1}.html :: content" type="thymeleaf"/>
</definition>
</tiles-definitions>

View File

@@ -1,16 +1,12 @@
<!DOCTYPE html> <!DOCTYPE html>
<html xmlns="http://www.w3.org/1999/xhtml" <html xmlns="http://www.w3.org/1999/xhtml"
xmlns:th="http://www.thymeleaf.org" xmlns:th="http://www.thymeleaf.org"
xmlns:tiles="http://www.thymeleaf.org"
xmlns:sec="http://www.thymeleaf.org"
lang="en"> lang="en">
<head> <head th:replace="layouts/standard.html :: //head">
<!-- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - --> <!-- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -->
<!-- This <head> section is only used for static prototyping purposes. At runtime, --> <!-- This <head> section is only used for static prototyping purposes. -->
<!-- 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> <title>Spring Travel: Spring MVC and Web Flow Reference Application</title>
@@ -23,31 +19,17 @@
href="../styles/blueprint/print.css" /> href="../styles/blueprint/print.css" />
<!--[if lt IE 8]> <!--[if lt IE 8]>
<link rel="stylesheet" type="text/css" media="screen, projection" <link rel="stylesheet" type="text/css" media="screen, projection"
href="../styles/blueprint/ie.css" /> href="../styles/blueprint/ie.css" />
<![endif]--> <![endif]-->
<link rel="stylesheet" type="text/css" media="screen" <link rel="stylesheet" type="text/css" media="screen" href="../styles/booking.css" />
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> </head>
<!-- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - --> <body th:replace="layouts/standard.html :: body(~{::bodyContent})">
<!-- 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> <div th:fragment="bodyContent">
<h1>Welcome to Spring Travel</h1> <h1>Welcome to Spring Travel</h1>
<p> <p>
This sample demonstrates how to use Spring MVC and Spring Web Flow together with Thymeleaf and Tiles. This sample demonstrates how to use Spring MVC and Spring Web Flow together with Thymeleaf and Tiles.
@@ -77,10 +59,6 @@
</p> </p>
</div> </div>
</body> </body>
<!-- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -->
<!-- END of the content to be included in the execution result -->
<!-- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -->
</html> </html>

View File

@@ -1,7 +1,6 @@
<!DOCTYPE html> <!DOCTYPE html>
<html xmlns="http://www.w3.org/1999/xhtml" <html xmlns="http://www.w3.org/1999/xhtml"
xmlns:th="http://www.thymeleaf.org" xmlns:th="http://www.thymeleaf.org"
xmlns:tiles="http://www.thymeleaf.org"
xmlns:sec="http://www.thymeleaf.org" xmlns:sec="http://www.thymeleaf.org"
lang="en"> lang="en">
@@ -41,7 +40,7 @@
</head> </head>
<body class="tundra"> <body class="tundra" th:fragment="body(bodyContent)">
<div id="page" class="container"> <div id="page" class="container">
@@ -77,16 +76,10 @@
</a> </a>
</p> </p>
</div> </div>
<div id="main" class="span-18 last" tiles:include="body"> <div id="main" class="span-18 last" th:insert="${bodyContent}">
<!-- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -->
<!-- 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! BODY PAGE GOES HERE!
</div> </div>
</div> </div>

View File

@@ -1,11 +0,0 @@
<?xml version="1.0" encoding="UTF-8"?>
<!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="standardLayout" template="/layouts/standard.html" templateType="thymeleaf"/>
<!-- <definition name="standardLayoutJSP" template="/WEB-INF/layouts/standard.jsp" templateType="jsp"/> -->
</tiles-definitions>

View File

@@ -1,52 +1,35 @@
<!DOCTYPE html> <!DOCTYPE html>
<html xmlns="http://www.w3.org/1999/xhtml" <html xmlns="http://www.w3.org/1999/xhtml"
xmlns:th="http://www.thymeleaf.org" xmlns:th="http://www.thymeleaf.org"
xmlns:tiles="http://www.thymeleaf.org"
xmlns:sec="http://www.thymeleaf.org"
lang="en"> lang="en">
<head> <head th:replace="layouts/standard.html :: //head">
<!-- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - --> <!-- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -->
<!-- This <head> section is only used for static prototyping purposes. At runtime, --> <!-- This <head> section is only used for static prototyping purposes. -->
<!-- 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> <title>Spring Travel: Spring MVC and Web Flow Reference Application</title>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" /> <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" />
<link rel="stylesheet" type="text/css" media="screen, projection"
<!-- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - --> href="../styles/blueprint/screen.css" />
<!-- Some styles and scripts are served from spring-js-resources-{ver}.jar at -->
<!-- runtime. Therefore not available for static prototyping. See the --> <link rel="stylesheet" type="text/css" media="print"
<!-- layouts/standard.html template file for detail. --> 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" />
</head> </head>
<!-- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - --> <body th:replace="layouts/standard.html :: body(~{::bodyContent})">
<!-- 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 th:fragment="bodyContent">
<div class="span-5"> <div class="span-5">
<p>Valid username/passwords are:</p> <p>Valid username/passwords are:</p>
@@ -127,6 +110,7 @@
</div> </div>
</div>
</body> </body>
<!-- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - --> <!-- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -->

View File

@@ -2,53 +2,35 @@
<html xmlns="http://www.w3.org/1999/xhtml" <html xmlns="http://www.w3.org/1999/xhtml"
xmlns:th="http://www.thymeleaf.org" xmlns:th="http://www.thymeleaf.org"
xmlns:tiles="http://www.thymeleaf.org" xmlns:tiles="http://www.thymeleaf.org"
xmlns:sec="http://www.thymeleaf.org"
lang="en"> lang="en">
<head> <head th:replace="layouts/standard.html :: //head">
<!-- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - --> <!-- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -->
<!-- This <head> section is only used for static prototyping purposes. At runtime, --> <!-- This <head> section is only used for static prototyping purposes. -->
<!-- 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> <title>Spring Travel: Spring MVC and Web Flow Reference Application</title>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" /> <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" />
<link rel="stylesheet" type="text/css" media="screen, projection"
<!-- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - --> href="../styles/blueprint/screen.css" />
<!-- Some styles and scripts are served from spring-js-resources-{ver}.jar at -->
<!-- runtime. Therefore not available for static prototyping. See the --> <link rel="stylesheet" type="text/css" media="print"
<!-- layouts/standard.html template file for detail. --> 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" />
</head> </head>
<!-- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - --> <body th:replace="layouts/standard.html :: body(~{::bodyContent})">
<!-- 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 th:fragment="bodyContent">
<div>
<h1>Logout</h1> <h1>Logout</h1>
<p>You have successfully logged out.</p> <p>You have successfully logged out.</p>
<hr /> <hr />
@@ -57,8 +39,5 @@
</body> </body>
<!-- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -->
<!-- END of the content to be included in the execution result -->
<!-- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -->
</html> </html>

View File

@@ -1,20 +0,0 @@
<?xml version="1.0" encoding="UTF-8"?>
<!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="intro" extends="standardLayout">
<put-attribute name="body" value="/intro.html :: content" type="thymeleaf"/>
</definition>
<definition name="login" extends="standardLayout">
<put-attribute name="body" value="/login.html :: content" type="thymeleaf"/>
</definition>
<definition name="logoutSuccess" extends="standardLayout">
<put-attribute name="body" value="/logoutSuccess.html :: content" type="thymeleaf"/>
</definition>
</tiles-definitions>