Switch to Web Flow 3.0
Upgrade to Spring Framework 6 and change package imports from servlet to jakarta. Not yet working as there is no Tiles anymore.
This commit is contained in:
@@ -52,21 +52,21 @@
|
||||
</dependency>
|
||||
<!-- Servlet -->
|
||||
<dependency>
|
||||
<groupId>javax.servlet</groupId>
|
||||
<artifactId>javax.servlet-api</artifactId>
|
||||
<groupId>jakarta.servlet</groupId>
|
||||
<artifactId>jakarta.servlet-api</artifactId>
|
||||
<version>${servlet.version}</version>
|
||||
<scope>provided</scope>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>javax.servlet.jsp</groupId>
|
||||
<artifactId>jsp-api</artifactId>
|
||||
<version>2.1</version>
|
||||
<groupId>jakarta.servlet.jsp</groupId>
|
||||
<artifactId>jakarta.servlet.jsp-api</artifactId>
|
||||
<version>${jsp-api.version}</version>
|
||||
<scope>provided</scope>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>javax.servlet</groupId>
|
||||
<artifactId>jstl</artifactId>
|
||||
<version>1.2</version>
|
||||
<groupId>jakarta.servlet.jsp.jstl</groupId>
|
||||
<artifactId>jakarta.servlet.jsp.jstl-api</artifactId>
|
||||
<version>${jstl-api}</version>
|
||||
</dependency>
|
||||
<!-- Thymeleaf -->
|
||||
<dependency>
|
||||
@@ -76,50 +76,21 @@
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.thymeleaf</groupId>
|
||||
<artifactId>thymeleaf-spring4</artifactId>
|
||||
<version>2.1.5.RELEASE</version>
|
||||
<artifactId>thymeleaf-spring6</artifactId>
|
||||
<version>3.1.0.M1</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.thymeleaf.extras</groupId>
|
||||
<artifactId>thymeleaf-extras-tiles2-spring4</artifactId>
|
||||
<version>2.1.1.RELEASE</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.thymeleaf.extras</groupId>
|
||||
<artifactId>thymeleaf-extras-springsecurity4</artifactId>
|
||||
<version>2.1.2.RELEASE</version>
|
||||
<artifactId>thymeleaf-extras-springsecurity6</artifactId>
|
||||
<version>3.1.0.M1</version>
|
||||
</dependency>
|
||||
<!--
|
||||
<dependency>
|
||||
<groupId>org.thymeleaf.extras</groupId>
|
||||
<artifactId>thymeleaf-extras-conditionalcomments</artifactId>
|
||||
<version>2.1.2.RELEASE</version>
|
||||
</dependency>
|
||||
<!-- Apache Tiles -->
|
||||
<dependency>
|
||||
<groupId>org.apache.tiles</groupId>
|
||||
<artifactId>tiles-core</artifactId>
|
||||
<version>${tiles.version}</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.apache.tiles</groupId>
|
||||
<artifactId>tiles-api</artifactId>
|
||||
<version>${tiles.version}</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.apache.tiles</groupId>
|
||||
<artifactId>tiles-template</artifactId>
|
||||
<version>${tiles.version}</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.apache.tiles</groupId>
|
||||
<artifactId>tiles-servlet</artifactId>
|
||||
<version>${tiles.version}</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.apache.tiles</groupId>
|
||||
<artifactId>tiles-jsp</artifactId>
|
||||
<version>${tiles.version}</version>
|
||||
</dependency>
|
||||
-->
|
||||
<!-- Database, JPA -->
|
||||
<dependency>
|
||||
<groupId>org.hsqldb</groupId>
|
||||
@@ -127,14 +98,25 @@
|
||||
<version>${hsqldb.version}</version>
|
||||
<scope>runtime</scope>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.hibernate</groupId>
|
||||
<artifactId>hibernate-core-jakarta</artifactId>
|
||||
<version>${hibernate.version}</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.hibernate</groupId>
|
||||
<artifactId>hibernate-entitymanager</artifactId>
|
||||
<version>${hibernate.version}</version>
|
||||
<exclusions>
|
||||
<exclusion>
|
||||
<groupId>org.hibernate</groupId>
|
||||
<artifactId>hibernate-core</artifactId>
|
||||
</exclusion>
|
||||
</exclusions>
|
||||
</dependency>
|
||||
<!-- JSR 303 with Hibernate Validator -->
|
||||
<dependency>
|
||||
<groupId>org.hibernate</groupId>
|
||||
<groupId>org.hibernate.validator</groupId>
|
||||
<artifactId>hibernate-validator</artifactId>
|
||||
<version>${hibernate-validator.version}</version>
|
||||
</dependency>
|
||||
@@ -212,16 +194,16 @@
|
||||
<plugin>
|
||||
<groupId>org.apache.maven.plugins</groupId>
|
||||
<artifactId>maven-compiler-plugin</artifactId>
|
||||
<version>3.7.0</version>
|
||||
<version>3.10.1</version>
|
||||
<configuration>
|
||||
<source>1.8</source>
|
||||
<target>1.8</target>
|
||||
<source>17</source>
|
||||
<target>17</target>
|
||||
</configuration>
|
||||
</plugin>
|
||||
<plugin>
|
||||
<groupId>org.apache.maven.plugins</groupId>
|
||||
<artifactId>maven-surefire-plugin</artifactId>
|
||||
<version>2.20.1</version>
|
||||
<version>2.22.2</version>
|
||||
<configuration>
|
||||
<junitArtifactName>junit:junit</junitArtifactName>
|
||||
<includes>
|
||||
|
||||
@@ -7,17 +7,17 @@ import java.util.Calendar;
|
||||
import java.util.Date;
|
||||
import java.util.Set;
|
||||
|
||||
import javax.persistence.Basic;
|
||||
import javax.persistence.Entity;
|
||||
import javax.persistence.GeneratedValue;
|
||||
import javax.persistence.GenerationType;
|
||||
import javax.persistence.Id;
|
||||
import javax.persistence.ManyToOne;
|
||||
import javax.persistence.Temporal;
|
||||
import javax.persistence.TemporalType;
|
||||
import javax.persistence.Transient;
|
||||
import javax.validation.constraints.Future;
|
||||
import javax.validation.constraints.NotNull;
|
||||
import jakarta.persistence.Basic;
|
||||
import jakarta.persistence.Entity;
|
||||
import jakarta.persistence.GeneratedValue;
|
||||
import jakarta.persistence.GenerationType;
|
||||
import jakarta.persistence.Id;
|
||||
import jakarta.persistence.ManyToOne;
|
||||
import jakarta.persistence.Temporal;
|
||||
import jakarta.persistence.TemporalType;
|
||||
import jakarta.persistence.Transient;
|
||||
import jakarta.validation.constraints.Future;
|
||||
import jakarta.validation.constraints.NotNull;
|
||||
|
||||
import org.hibernate.validator.constraints.NotEmpty;
|
||||
import org.springframework.format.annotation.DateTimeFormat;
|
||||
|
||||
@@ -5,8 +5,8 @@ import java.lang.annotation.Retention;
|
||||
import java.lang.annotation.RetentionPolicy;
|
||||
import java.lang.annotation.Target;
|
||||
|
||||
import javax.validation.Constraint;
|
||||
import javax.validation.Payload;
|
||||
import jakarta.validation.Constraint;
|
||||
import jakarta.validation.Payload;
|
||||
|
||||
@Constraint(validatedBy = BookingDateRangeValidator.class)
|
||||
@Target({ ElementType.TYPE, ElementType.METHOD, ElementType.FIELD, ElementType.CONSTRUCTOR, ElementType.PARAMETER })
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
package org.springframework.webflow.samples.booking;
|
||||
|
||||
import javax.validation.ConstraintValidator;
|
||||
import javax.validation.ConstraintValidatorContext;
|
||||
import jakarta.validation.ConstraintValidator;
|
||||
import jakarta.validation.ConstraintValidatorContext;
|
||||
|
||||
public class BookingDateRangeValidator implements ConstraintValidator<BookingDateRange, Booking> {
|
||||
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
package org.springframework.webflow.samples.booking;
|
||||
|
||||
import javax.servlet.http.HttpServletRequest;
|
||||
import javax.servlet.http.HttpServletResponse;
|
||||
import jakarta.servlet.http.HttpServletRequest;
|
||||
import jakarta.servlet.http.HttpServletResponse;
|
||||
|
||||
import org.springframework.webflow.core.FlowException;
|
||||
import org.springframework.webflow.execution.FlowExecutionOutcome;
|
||||
|
||||
@@ -3,10 +3,10 @@ package org.springframework.webflow.samples.booking;
|
||||
import java.io.Serializable;
|
||||
import java.math.BigDecimal;
|
||||
|
||||
import javax.persistence.Column;
|
||||
import javax.persistence.Entity;
|
||||
import javax.persistence.GeneratedValue;
|
||||
import javax.persistence.Id;
|
||||
import jakarta.persistence.Column;
|
||||
import jakarta.persistence.Entity;
|
||||
import jakarta.persistence.GeneratedValue;
|
||||
import jakarta.persistence.Id;
|
||||
|
||||
/**
|
||||
* A hotel where users may book stays.
|
||||
|
||||
@@ -2,8 +2,8 @@ package org.springframework.webflow.samples.booking;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
import javax.persistence.EntityManager;
|
||||
import javax.persistence.PersistenceContext;
|
||||
import jakarta.persistence.EntityManager;
|
||||
import jakarta.persistence.PersistenceContext;
|
||||
|
||||
import org.springframework.stereotype.Repository;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
@@ -2,9 +2,9 @@ package org.springframework.webflow.samples.booking;
|
||||
|
||||
import java.io.Serializable;
|
||||
|
||||
import javax.persistence.Entity;
|
||||
import javax.persistence.Id;
|
||||
import javax.persistence.Table;
|
||||
import jakarta.persistence.Entity;
|
||||
import jakarta.persistence.Id;
|
||||
import jakarta.persistence.Table;
|
||||
|
||||
/**
|
||||
* A user who can book hotels.
|
||||
|
||||
@@ -2,7 +2,7 @@ package org.springframework.webflow.samples.booking.config;
|
||||
|
||||
import java.util.Collections;
|
||||
|
||||
import javax.persistence.EntityManagerFactory;
|
||||
import jakarta.persistence.EntityManagerFactory;
|
||||
import javax.sql.DataSource;
|
||||
|
||||
import org.springframework.context.annotation.Bean;
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
package org.springframework.webflow.samples.booking.config;
|
||||
|
||||
import javax.servlet.Filter;
|
||||
import jakarta.servlet.Filter;
|
||||
|
||||
import org.springframework.web.filter.HiddenHttpMethodFilter;
|
||||
import org.springframework.web.servlet.support.AbstractAnnotationConfigDispatcherServletInitializer;
|
||||
|
||||
@@ -7,4 +7,5 @@ import org.springframework.security.web.context.AbstractSecurityWebApplicationIn
|
||||
* the chain of Spring Security filters.
|
||||
*/
|
||||
public class SecurityWebApplicationInitializer extends AbstractSecurityWebApplicationInitializer {
|
||||
|
||||
}
|
||||
|
||||
@@ -7,13 +7,11 @@ 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.ViewResolverRegistry;
|
||||
import org.springframework.web.servlet.config.annotation.WebMvcConfigurer;
|
||||
import org.springframework.web.servlet.view.tiles3.TilesConfigurer;
|
||||
import org.springframework.web.servlet.view.InternalResourceViewResolver;
|
||||
import org.springframework.web.servlet.view.UrlBasedViewResolver;
|
||||
import org.springframework.webflow.mvc.servlet.FlowHandlerAdapter;
|
||||
import org.springframework.webflow.mvc.servlet.FlowHandlerMapping;
|
||||
import org.springframework.webflow.mvc.view.AjaxUrlBasedViewResolver;
|
||||
import org.springframework.webflow.mvc.view.FlowAjaxTiles3View;
|
||||
import org.springframework.webflow.samples.booking.BookingFlowHandler;
|
||||
|
||||
@EnableWebMvc
|
||||
@@ -62,17 +60,8 @@ public class WebMvcConfig implements WebMvcConfigurer {
|
||||
}
|
||||
|
||||
@Bean
|
||||
public AjaxUrlBasedViewResolver viewResolver() {
|
||||
AjaxUrlBasedViewResolver resolver = new AjaxUrlBasedViewResolver();
|
||||
resolver.setViewClass(FlowAjaxTiles3View.class);
|
||||
return resolver;
|
||||
}
|
||||
|
||||
@Bean
|
||||
public TilesConfigurer tilesConfigurer() {
|
||||
TilesConfigurer configurer = new TilesConfigurer();
|
||||
configurer.setDefinitions("/WEB-INF/**/views.xml");
|
||||
return configurer;
|
||||
public UrlBasedViewResolver viewResolver() {
|
||||
return new InternalResourceViewResolver();
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -7,6 +7,7 @@
|
||||
</Appenders>
|
||||
<Loggers>
|
||||
<Logger name="org.springframework.samples" level="debug" />
|
||||
<Logger name="org.springframework.web" level="debug" />
|
||||
<Root level="info">
|
||||
<AppenderRef ref="Console" />
|
||||
</Root>
|
||||
|
||||
21
pom.xml
21
pom.xml
@@ -10,26 +10,29 @@
|
||||
|
||||
<modules>
|
||||
<module>booking-mvc</module>
|
||||
<!--
|
||||
<module>booking-faces</module>
|
||||
<module>primefaces-showcase</module>
|
||||
<module>webflow-showcase</module>
|
||||
-->
|
||||
</modules>
|
||||
|
||||
<properties>
|
||||
<easymock.version>3.4</easymock.version>
|
||||
<hsqldb.version>2.5.1</hsqldb.version>
|
||||
<hibernate.version>5.4.33.Final</hibernate.version>
|
||||
<hibernate-validator.version>6.2.3.Final</hibernate-validator.version>
|
||||
<hibernate.version>5.6.10.Final</hibernate.version>
|
||||
<hibernate-validator.version>7.0.4.Final</hibernate-validator.version>
|
||||
<jaxb.version>2.2.3</jaxb.version>
|
||||
<jetty-maven-plugin.version>9.4.48.v20220622</jetty-maven-plugin.version>
|
||||
<jetty-maven-plugin.version>11.0.11</jetty-maven-plugin.version>
|
||||
<jsp-api.version>3.0.0</jsp-api.version>
|
||||
<jstl-api>2.0.0</jstl-api>
|
||||
<junit.version>4.13.2</junit.version>
|
||||
<log4j.version>2.14.0</log4j.version>
|
||||
<mojarra.version>2.2.20</mojarra.version>
|
||||
<myfaces.version>2.3.8</myfaces.version>
|
||||
<primefaces.version>8.0</primefaces.version>
|
||||
<servlet.version>3.1.0</servlet.version>
|
||||
<tiles.version>3.0.8</tiles.version>
|
||||
<webflow.version>2.5.1.RELEASE</webflow.version>
|
||||
<servlet.version>5.0.0</servlet.version>
|
||||
<webflow.version>3.0.0-SNAPSHOT</webflow.version>
|
||||
</properties>
|
||||
|
||||
<dependencyManagement>
|
||||
@@ -37,7 +40,7 @@
|
||||
<dependency>
|
||||
<groupId>org.springframework</groupId>
|
||||
<artifactId>spring-framework-bom</artifactId>
|
||||
<version>5.3.22</version>
|
||||
<version>6.0.0-M5</version>
|
||||
<type>pom</type>
|
||||
<scope>import</scope>
|
||||
</dependency>
|
||||
@@ -46,7 +49,7 @@
|
||||
<artifactId>spring-security-bom</artifactId>
|
||||
<type>pom</type>
|
||||
<scope>import</scope>
|
||||
<version>5.6.6</version>
|
||||
<version>6.0.0-M5</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.slf4j</groupId>
|
||||
@@ -56,7 +59,6 @@
|
||||
</dependencies>
|
||||
</dependencyManagement>
|
||||
|
||||
<!--
|
||||
<repositories>
|
||||
<repository>
|
||||
<id>spring-snapshot</id>
|
||||
@@ -69,6 +71,5 @@
|
||||
<url>https://repo.spring.io/milestone</url>
|
||||
</repository>
|
||||
</repositories>
|
||||
-->
|
||||
|
||||
</project>
|
||||
|
||||
Reference in New Issue
Block a user