<?xml version="1.0" encoding="ISO-8859-1"?>
<web-app version="2.4" xmlns="http://java.sun.com/xml/ns/j2ee" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
		xsi:schemaLocation="http://java.sun.com/xml/ns/j2ee http://java.sun.com/xml/ns/j2ee/web-app_2_4.xsd">

	<display-name>Spring JPetStore</display-name>

	<description>Spring JPetStore sample application</description>

	<!--
		- Key of the system property that should specify the root directory of this
		- web app. Applied by WebAppRootListener or Log4jConfigListener.
	-->
	<context-param>
		<param-name>webAppRootKey</param-name>
		<param-value>petstore.root</param-value>
	</context-param>

	<!--
		- Location of the Log4J config file, for initialization and refresh checks.
		- Applied by Log4jConfigListener.
	-->
	<context-param>
		<param-name>log4jConfigLocation</param-name>
		<param-value>/WEB-INF/log4j.properties</param-value>
	</context-param>

	<!--
		- Location of the XML file that defines the root application context.
		- Applied by ContextLoaderServlet.
		-
		- Can include "/WEB-INF/dataAccessContext-local.xml" for a single-database
		- context, or "/WEB-INF/dataAccessContext-jta.xml" for a two-database context.
	-->
	<context-param>
		<param-name>contextConfigLocation</param-name>
		<param-value>/WEB-INF/dataAccessContext-local.xml /WEB-INF/applicationContext.xml</param-value>
		<!--
		<param-value>/WEB-INF/dataAccessContext-jta.xml  /WEB-INF/applicationContext.xml</param-value>
		-->
	</context-param>

	<!--
		- Configures Log4J for this web app.
		- As this context specifies a context-param "log4jConfigLocation", its file path
		- is used to load the Log4J configuration, including periodic refresh checks.
		-
		- Would fall back to default Log4J initialization (non-refreshing) if no special
		- context-params are given.
		-
		- Exports a "web app root key", i.e. a system property that specifies the root
		- directory of this web app, for usage in log file paths.
		- This web app specifies "petclinic.root" (see log4j.properties file).
	-->
	<!-- Leave the listener commented-out if using JBoss -->
	<!--
	<listener>
		<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>

	<!--
		- Spring web MVC servlet that dispatches requests to registered handlers.
		- Has its own application context, by default defined in "{servlet-name}-servlet.xml",
		- i.e. "petstore-servlet.xml" in this case.
		-
		- A web app can contain any number of such servlets.
		- Note that this web app has a shared root application context, serving as parent
		- of all DispatcherServlet contexts.
	-->
	<servlet>
		<servlet-name>petstore</servlet-name>
		<servlet-class>org.springframework.web.servlet.DispatcherServlet</servlet-class>
		<load-on-startup>2</load-on-startup>
	</servlet>

	<!--
		- Struts servlet that dispatches requests to registered actions.
		- Reads its configuration from "struts-config.xml".
		-
		- A web app can just contain one such servlet.
		- If you need multiple namespaces, use Struts' module mechanism.
	-->
	<servlet>
		<servlet-name>action</servlet-name>
		<servlet-class>org.apache.struts.action.ActionServlet</servlet-class>
		<load-on-startup>3</load-on-startup>
	</servlet>

	<!--
		- Dispatcher servlet definition for HTTP remoting via Hessian, Burlap, and
		- Spring's HTTP invoker (see remoting-servlet.xml for the controllers).
	-->
	<servlet>
		<servlet-name>remoting</servlet-name>
		<servlet-class>org.springframework.web.servlet.DispatcherServlet</servlet-class>
		<load-on-startup>4</load-on-startup>
	</servlet>

	<!--
		- Servlet definition for Web Service remoting via Apache Axis
		- (see server-config.wsdd for Axis configuration).
	-->
	<servlet>
		<servlet-name>axis</servlet-name>
		<servlet-class>org.apache.axis.transport.http.AxisServlet</servlet-class>
		<load-on-startup>5</load-on-startup>
	</servlet>

	<!--
		- Dispatcher servlet mapping for the main web user interface.
		- Either refering to "petstore" for the Spring web MVC dispatcher,
		- or to "action" for the Struts dispatcher.
		-
		- Simply comment out the "petstore" reference in favour of "action"
		- to switch from the Spring web tier to the Struts web tier.
	-->
	<servlet-mapping>
		<servlet-name>petstore</servlet-name>
		<!--
		<servlet-name>action</servlet-name>
		-->
		<url-pattern>*.do</url-pattern>
	</servlet-mapping>

	<!--
		- Dispatcher servlet mapping for HTTP remoting via Hessian, Burlap, and
		- Spring's HTTP invoker (see remoting-servlet.xml for the controllers).
	-->
	<servlet-mapping>
		<servlet-name>remoting</servlet-name>
		<url-pattern>/remoting/*</url-pattern>
	</servlet-mapping>

	<!--
		- Servlet mapping for Web Service remoting via Apache Axis
		- (see server-config.wsdd for Axis configuration).
	-->
	<servlet-mapping>
		<servlet-name>axis</servlet-name>
		<url-pattern>/axis/*</url-pattern>
	</servlet-mapping>

	<welcome-file-list>
		<welcome-file>index.html</welcome-file>
	</welcome-file-list>

	<!--
		- Reference to main database.
		- Only needed for JTA (dataAccessContext-jta.xml).
	-->
	<!--
	<resource-ref>
		<res-ref-name>jdbc/jpetstore</res-ref-name>
		<res-type>javax.sql.DataSource</res-type>
		<res-auth>Container</res-auth>
	</resource-ref>
	-->

	<!--
		- Reference to order database.
		- Only needed for JTA (dataAccessContext-jta.xml).
	-->
	<!--
	<resource-ref>
		<res-ref-name>jdbc/jpetstore-order</res-ref-name>
		<res-type>javax.sql.DataSource</res-type>
		<res-auth>Container</res-auth>
	</resource-ref>
	-->

</web-app>
