diff --git a/src/main/webapp/WEB-INF/web.xml b/src/main/webapp/WEB-INF/web.xml index 75ba1b90bb0d7463080d86efac44b9e9f864418d..37169b5094f998d28559f1690dab56d0179fd687 100644 --- a/src/main/webapp/WEB-INF/web.xml +++ b/src/main/webapp/WEB-INF/web.xml @@ -18,6 +18,10 @@ <context-param> <param-name>spring.profiles.active</param-name> <param-value>jdbc</param-value> + <!-- you can replace the above param with: + <param-value>jpa,plain-jpa</param-value> (in the case of plain JPA) + <param-value>jpa,spring-data</param-value> (in the case of Spring Data JPA) + --> </context-param> <!-- @@ -26,26 +30,16 @@ --> <context-param> <param-name>log4jConfigLocation</param-name> - <param-value>/WEB-INF/classes/log4j.properties</param-value> + <param-value>/WEB-INF/classes/log4j.xml</param-value> </context-param> <!-- - Location of the XML file that defines the root application context. - Applied by ContextLoaderServlet. - - - - Can be set to: - - "/WEB-INF/applicationContext-hibernate.xml" for the Hibernate implementation, - - "/WEB-INF/applicationContext-jpa.xml" for the JPA one, or - - "/WEB-INF/applicationContext-jdbc.xml" for the JDBC one. --> <context-param> <param-name>contextConfigLocation</param-name> <param-value>classpath:spring/applicationContext-dao.xml</param-value> - <!-- - <param-value>/WEB-INF/spring/applicationContext-hibernate.xml</param-value> - <param-value>/WEB-INF/spring/applicationContext-jpa.xml</param-value> - --> - <!-- To use the JPA variant above, you will need to enable Spring load-time weaving in your server environment. Out of the box, Spring will try to @@ -54,6 +48,10 @@ See PetClinic's readme and/or Spring's JPA documentation for more information. --> </context-param> + + <listener> + <listener-class>org.springframework.web.context.ContextLoaderListener</listener-class> + </listener> <!-- - Configures Log4J for this web app. @@ -73,54 +71,6 @@ <listener-class>org.springframework.web.util.Log4jConfigListener</listener-class> </listener> --> - - <!-- - - Loads the root application context of this web app at startup, - - by default from "/WEB-INF/applicationContext.xml". - - Note that you need to fall back to Spring's ContextLoaderServlet for - - J2EE servers that do not follow the Servlet 2.4 initialization order. - - - - Use WebApplicationContextUtils.getWebApplicationContext(servletContext) - - to access it anywhere in the web application, outside of the framework. - - - - The root context is the parent of all servlet-specific contexts. - - This means that its beans are automatically available in these child contexts, - - both for getBean(name) calls and (external) bean references. - --> - <listener> - <listener-class>org.springframework.web.context.ContextLoaderListener</listener-class> - </listener> - - <!-- - Defines the 'default' servlet (usually for service static resources). - Uncomment this in containers (GlassFish) that do not declare this - implicit definition out of the box, or change the name of the servlet mapping - below to the appropriate one. - - <servlet> - <servlet-name>default</servlet-name> - <servlet-class>org.apache.catalina.servlets.DefaultServlet</servlet-class> - <init-param> - <param-name>debug</param-name> - <param-value>0</param-value> - </init-param> - <init-param> - <param-name>listings</param-name> - <param-value>false</param-value> - </init-param> - <load-on-startup>1</load-on-startup> - </servlet> - --> - <!-- - - Map static resources to the default servlet - - examples: - - http://localhost:8080/static/images/pets.png - - http://localhost:8080/static/styles/petclinic.css - --> - <servlet-mapping> - <servlet-name>default</servlet-name> - <url-pattern>/static/*</url-pattern> - </servlet-mapping> <!-- - Servlet that dispatches request to registered handlers (Controller implementations). @@ -134,7 +84,7 @@ <servlet> <servlet-name>petclinic</servlet-name> <servlet-class>org.springframework.web.servlet.DispatcherServlet</servlet-class> - <load-on-startup>2</load-on-startup> + <load-on-startup>1</load-on-startup> </servlet> <!-- @@ -163,23 +113,5 @@ <session-config> <session-timeout>10</session-timeout> </session-config> - - <!-- eliminate welcome files --> - <!-- useful for Servlet 3 container (Tomcat 7 and Jetty 6) --> - <welcome-file-list> - <welcome-file></welcome-file> - </welcome-file-list> - - <!-- - - Reference to PetClinic database. - - Only needed if not using a local DataSource but a JNDI one instead. - --> - <!-- - <resource-ref> - <res-ref-name>jdbc/petclinic</res-ref-name> - <res-type>javax.sql.DataSource</res-type> - <res-auth>Container</res-auth> - </resource-ref> - --> </web-app> \ No newline at end of file