mirror of
https://github.com/spring-projects/spring-petclinic.git
synced 2025-05-21 03:19:38 +00:00
Added compatibility with Servlet2.x containers
This commit is contained in:
parent
e44552ea4c
commit
65065a8979
2 changed files with 94 additions and 64 deletions
6
pom.xml
6
pom.xml
|
@ -49,6 +49,7 @@
|
||||||
<webjars-jquery.version>1.9.0</webjars-jquery.version>
|
<webjars-jquery.version>1.9.0</webjars-jquery.version>
|
||||||
<dandelion.datatables.version>0.8.5</dandelion.datatables.version>
|
<dandelion.datatables.version>0.8.5</dandelion.datatables.version>
|
||||||
<dandelion.datatables.export.itext.version>0.1.5</dandelion.datatables.export.itext.version>
|
<dandelion.datatables.export.itext.version>0.1.5</dandelion.datatables.export.itext.version>
|
||||||
|
<dandelion.datatables.servlet2.version>0.1.4</dandelion.datatables.servlet2.version>
|
||||||
|
|
||||||
<maven-assembly-plugin.version>2.4</maven-assembly-plugin.version>
|
<maven-assembly-plugin.version>2.4</maven-assembly-plugin.version>
|
||||||
<maven-clean-plugin.version>2.5</maven-clean-plugin.version>
|
<maven-clean-plugin.version>2.5</maven-clean-plugin.version>
|
||||||
|
@ -247,6 +248,11 @@
|
||||||
<artifactId>datatables-export-itext</artifactId>
|
<artifactId>datatables-export-itext</artifactId>
|
||||||
<version>${dandelion.datatables.export.itext.version}</version>
|
<version>${dandelion.datatables.export.itext.version}</version>
|
||||||
</dependency>
|
</dependency>
|
||||||
|
<dependency>
|
||||||
|
<groupId>com.github.dandelion</groupId>
|
||||||
|
<artifactId>datatables-servlet2</artifactId>
|
||||||
|
<version>${dandelion.datatables.servlet2.version}</version>
|
||||||
|
</dependency>
|
||||||
</dependencies>
|
</dependencies>
|
||||||
|
|
||||||
<!-- all Maven plugin versions are mentioned in order to guarantee the build reproducibility in the long term -->
|
<!-- all Maven plugin versions are mentioned in order to guarantee the build reproducibility in the long term -->
|
||||||
|
|
|
@ -1,65 +1,89 @@
|
||||||
<?xml version="1.0" encoding="ISO-8859-1"?>
|
<?xml version="1.0" encoding="ISO-8859-1"?>
|
||||||
<web-app xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
|
<web-app xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
|
||||||
xmlns="http://java.sun.com/xml/ns/javaee"
|
xmlns="http://java.sun.com/xml/ns/javaee"
|
||||||
xsi:schemaLocation="http://java.sun.com/xml/ns/javaee
|
xsi:schemaLocation="http://java.sun.com/xml/ns/javaee
|
||||||
http://java.sun.com/xml/ns/javaee/web-app_2_5.xsd"
|
http://java.sun.com/xml/ns/javaee/web-app_2_5.xsd"
|
||||||
id="WebApp_ID" version="2.5">
|
id="WebApp_ID" version="2.5">
|
||||||
|
|
||||||
<display-name>Spring PetClinic</display-name>
|
<display-name>Spring PetClinic</display-name>
|
||||||
<description>Spring PetClinic sample application</description>
|
<description>Spring PetClinic sample application</description>
|
||||||
|
|
||||||
<context-param>
|
<context-param>
|
||||||
<param-name>spring.profiles.active</param-name>
|
<param-name>spring.profiles.active</param-name>
|
||||||
<param-value>jdbc</param-value>
|
<param-value>jdbc</param-value>
|
||||||
<!-- Available profiles:
|
<!-- Available profiles:
|
||||||
<param-value>jdbc</param-value>
|
<param-value>jdbc</param-value>
|
||||||
<param-value>jpa</param-value> (in the case of plain JPA)
|
<param-value>jpa</param-value> (in the case of plain JPA)
|
||||||
<param-value>spring-data-jpa</param-value> (in the case of Spring Data JPA)
|
<param-value>spring-data-jpa</param-value> (in the case of Spring Data JPA)
|
||||||
-->
|
-->
|
||||||
</context-param>
|
</context-param>
|
||||||
|
|
||||||
<!--
|
<!--
|
||||||
- Location of the XML file that defines the root application context.
|
- Location of the XML file that defines the root application context.
|
||||||
- Applied by ContextLoaderServlet.
|
- Applied by ContextLoaderServlet.
|
||||||
-->
|
-->
|
||||||
<context-param>
|
<context-param>
|
||||||
<param-name>contextConfigLocation</param-name>
|
<param-name>contextConfigLocation</param-name>
|
||||||
<param-value>classpath:spring/dao-config.xml, classpath:spring/tools-config.xml</param-value>
|
<param-value>classpath:spring/dao-config.xml, classpath:spring/tools-config.xml</param-value>
|
||||||
</context-param>
|
</context-param>
|
||||||
|
|
||||||
<listener>
|
<listener>
|
||||||
<listener-class>org.springframework.web.context.ContextLoaderListener</listener-class>
|
<listener-class>org.springframework.web.context.ContextLoaderListener</listener-class>
|
||||||
</listener>
|
</listener>
|
||||||
|
|
||||||
<!--
|
<!--
|
||||||
- Servlet that dispatches request to registered handlers (Controller implementations).
|
- Servlet that dispatches request to registered handlers (Controller implementations).
|
||||||
-->
|
-->
|
||||||
<servlet>
|
<servlet>
|
||||||
<servlet-name>petclinic</servlet-name>
|
<servlet-name>petclinic</servlet-name>
|
||||||
<servlet-class>org.springframework.web.servlet.DispatcherServlet</servlet-class>
|
<servlet-class>org.springframework.web.servlet.DispatcherServlet</servlet-class>
|
||||||
<init-param>
|
<init-param>
|
||||||
<param-name>contextConfigLocation</param-name>
|
<param-name>contextConfigLocation</param-name>
|
||||||
<param-value>classpath:spring/mvc-core-config.xml</param-value>
|
<param-value>classpath:spring/mvc-core-config.xml</param-value>
|
||||||
</init-param>
|
</init-param>
|
||||||
<load-on-startup>1</load-on-startup>
|
<load-on-startup>1</load-on-startup>
|
||||||
</servlet>
|
</servlet>
|
||||||
|
|
||||||
<servlet-mapping>
|
<servlet-mapping>
|
||||||
<servlet-name>petclinic</servlet-name>
|
<servlet-name>petclinic</servlet-name>
|
||||||
<url-pattern>/</url-pattern>
|
<url-pattern>/</url-pattern>
|
||||||
</servlet-mapping>
|
</servlet-mapping>
|
||||||
|
|
||||||
<!-- used so we can use forms of method type 'PUT' and 'DELETE'
|
<!-- Dandelion-Datatables servlet definition -->
|
||||||
see here: http://static.springsource.org/spring/docs/current/spring-framework-reference/html/view.html#rest-method-conversion
|
<servlet>
|
||||||
-->
|
<servlet-name>datatablesController</servlet-name>
|
||||||
<filter>
|
<servlet-class>com.github.dandelion.datatables.extras.servlet2.servlet.DatatablesServlet</servlet-class>
|
||||||
<filter-name>httpMethodFilter</filter-name>
|
</servlet>
|
||||||
<filter-class>org.springframework.web.filter.HiddenHttpMethodFilter</filter-class>
|
|
||||||
</filter>
|
<!-- Dandelion-Datatables servlet mapping -->
|
||||||
|
<servlet-mapping>
|
||||||
<filter-mapping>
|
<servlet-name>datatablesController</servlet-name>
|
||||||
<filter-name>httpMethodFilter</filter-name>
|
<url-pattern>/datatablesController/*</url-pattern>
|
||||||
<servlet-name>petclinic</servlet-name>
|
</servlet-mapping>
|
||||||
</filter-mapping>
|
|
||||||
|
<!-- Dandelion-Datatables filter definition -->
|
||||||
|
<filter>
|
||||||
|
<filter-name>datatablesFilter</filter-name>
|
||||||
|
<filter-class>com.github.dandelion.datatables.extras.servlet2.filter.DatatablesFilter</filter-class>
|
||||||
|
</filter>
|
||||||
|
|
||||||
|
<!-- Dandelion-Datatables filter mapping -->
|
||||||
|
<filter-mapping>
|
||||||
|
<filter-name>datatablesFilter</filter-name>
|
||||||
|
<url-pattern>/*</url-pattern>
|
||||||
|
</filter-mapping>
|
||||||
|
|
||||||
|
<!-- used so we can use forms of method type 'PUT' and 'DELETE'
|
||||||
|
see here: http://static.springsource.org/spring/docs/current/spring-framework-reference/html/view.html#rest-method-conversion
|
||||||
|
-->
|
||||||
|
<filter>
|
||||||
|
<filter-name>httpMethodFilter</filter-name>
|
||||||
|
<filter-class>org.springframework.web.filter.HiddenHttpMethodFilter</filter-class>
|
||||||
|
</filter>
|
||||||
|
|
||||||
|
<filter-mapping>
|
||||||
|
<filter-name>httpMethodFilter</filter-name>
|
||||||
|
<servlet-name>petclinic</servlet-name>
|
||||||
|
</filter-mapping>
|
||||||
|
|
||||||
</web-app>
|
</web-app>
|
Loading…
Reference in a new issue