<?xml version="1.0" encoding="UTF-8"?>

<!-- web.xml link de configuração http://static.springsource.org/spring-security/site/docs/3.0.x/reference/ns-config.html -->

<web-app version="3.0" xmlns="http://java.sun.com/xml/ns/javaee"
	xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
	xsi:schemaLocation="http://java.sun.com/xml/ns/javaee http://java.sun.com/xml/ns/javaee/web-app_3_0.xsd">

	<description>ventaboletos</description>
	<display-name>ventaboletosadm</display-name>

	<context-param>
	  <param-name>com.newrelic.agent.APPLICATION_NAME</param-name>
	  <param-value>ventaboletosadm</param-value>
	</context-param>
	
	<!-- Auto scan REST service -->
	<context-param>
		<param-name>resteasy.scan</param-name>
		<param-value>true</param-value>
	</context-param>
	<!-- this need same with resteasy servlet url-pattern -->
	<context-param>
		<param-name>resteasy.servlet.mapping.prefix</param-name>
		<param-value>/rest</param-value>
	</context-param>

	<listener>
		<listener-class>org.jboss.resteasy.plugins.server.servlet.ResteasyBootstrap</listener-class>
	</listener>

	<servlet>
		<servlet-name>resteasy-servlet</servlet-name>
		<servlet-class>org.jboss.resteasy.plugins.server.servlet.HttpServletDispatcher</servlet-class>
	</servlet>

	<servlet-mapping>
		<servlet-name>resteasy-servlet</servlet-name>
		<url-pattern>/rest/*</url-pattern>
	</servlet-mapping>


	<!-- Spring ApplicationContext -->
	<context-param>
		<param-name>contextConfigLocation</param-name>
		<param-value>
            classpath:spring-config.xml
            classpath:applicationContext-security.xml
        </param-value>
	</context-param>
	<!-- <context-param> -->
	<!-- <param-name>log4jConfigLocation</param-name> -->
	<!-- <param-value>classpath:com/rjconsultores/ventaboletos/web/cliente/conf/log4j.xml</param-value> -->
	<!-- </context-param> -->

	<!-- - Loads the root application context of this web app at startup. - 
		The application context is then available via - WebApplicationContextUtils.getWebApplicationContext(servletContext). -->
	<!-- <listener> -->
	<!-- <listener-class>org.springframework.web.util.Log4jConfigListener</listener-class> -->
	<!-- </listener> -->
	<listener>
		<listener-class>org.springframework.web.context.ContextLoaderListener</listener-class>
	</listener>
	<listener>
		<listener-class>org.springframework.web.context.request.RequestContextListener</listener-class>
	</listener>
	<listener>
		<listener-class>org.springframework.security.web.session.HttpSessionEventPublisher</listener-class>
	</listener>


	<!-- //// -->
	<!-- ZK -->

	<listener>
		<description>ZK listener for session cleanup</description>
		<listener-class>org.zkoss.zk.ui.http.HttpSessionListener</listener-class>
	</listener>
	<filter>
		<filter-name>Spring OpenSessionInViewFilter</filter-name>
		<filter-class>org.springframework.orm.hibernate3.support.OpenSessionInViewFilter</filter-class>
	</filter>

	<filter-mapping>
		<filter-name>Spring OpenSessionInViewFilter</filter-name>
		<url-pattern>/*</url-pattern>
	</filter-mapping>
	<servlet>
		<description>ZK loader for ZUML pages</description>
		<servlet-name>zkLoader</servlet-name>
		<servlet-class>org.zkoss.zk.ui.http.DHtmlLayoutServlet</servlet-class>
		<init-param>
			<param-name>update-uri</param-name>
			<param-value>/zkau</param-value>
		</init-param>
		<load-on-startup>1</load-on-startup><!-- Must -->
	</servlet>
	<servlet-mapping>
		<servlet-name>zkLoader</servlet-name>
		<url-pattern>*.zul</url-pattern>
	</servlet-mapping>
	<servlet-mapping>
		<servlet-name>zkLoader</servlet-name>
		<url-pattern>*.zhtml</url-pattern>
	</servlet-mapping>
	<servlet-mapping>
		<servlet-name>zkLoader</servlet-name>
		<url-pattern>*.svg</url-pattern>
	</servlet-mapping>
	<servlet-mapping>
		<servlet-name>zkLoader</servlet-name>
		<url-pattern>*.xml2html</url-pattern>
	</servlet-mapping>
	<servlet-mapping>
		<servlet-name>zkLoader</servlet-name>
		<url-pattern>*.mul</url-pattern>
	</servlet-mapping>

	<!-- Optional. Uncomment it if you want to use richlets. -->
	<servlet-mapping>
		<servlet-name>zkLoader</servlet-name>
		<url-pattern>/zk/*</url-pattern>
	</servlet-mapping>

	<servlet>
		<description>The asynchronous update engine for ZK</description>
		<servlet-name>auEngine</servlet-name>
		<servlet-class>org.zkoss.zk.au.http.DHtmlUpdateServlet</servlet-class>
	</servlet>
	<servlet-mapping>
		<servlet-name>auEngine</servlet-name>
		<url-pattern>/zkau/*</url-pattern>
	</servlet-mapping>
	<!-- - Spring Security Filter Chains -->
	<filter>
		<filter-name>springSecurityFilterChain</filter-name>
		<filter-class>org.springframework.web.filter.DelegatingFilterProxy</filter-class>
	</filter>

	<filter-mapping>
		<filter-name>springSecurityFilterChain</filter-name>
		<url-pattern>/*</url-pattern>
	</filter-mapping>
	<servlet>
		<servlet-name>dspLoader</servlet-name>
		<servlet-class>org.zkoss.web.servlet.dsp.InterpreterServlet</servlet-class>
		<init-param>
			<param-name>class-resource</param-name>
			<param-value>true</param-value>
		</init-param>
	</servlet>
	<servlet>
		<description>
    	</description>
		<display-name>ImageServlet</display-name>
		<servlet-name>ImageServlet</servlet-name>
		<servlet-class>com.rjconsultores.ventaboletos.web.utilerias.servlet.ImageServlet</servlet-class>
	</servlet>
	<servlet>
		<description>
    	</description>
		<display-name>ReloadFlyway</display-name>
		<servlet-name>ReloadFlyway</servlet-name>
		<servlet-class>com.rjconsultores.ventaboletos.servlet.ReloadFlyway</servlet-class>
	</servlet>
	<servlet>
		<description>
    	</description>
		<display-name>ReloadDBConnection</display-name>
		<servlet-name>ReloadDBConnection</servlet-name>
		<servlet-class>com.rjconsultores.ventaboletos.web.utilerias.servlet.ReloadDBConnection</servlet-class>
	</servlet>
	<servlet-mapping>
		<servlet-name>dspLoader</servlet-name>
		<url-pattern>*.dsp</url-pattern>
	</servlet-mapping>
	<servlet-mapping>
		<servlet-name>ImageServlet</servlet-name>
		<url-pattern>/ImageServlet</url-pattern>
	</servlet-mapping>
	<servlet-mapping>
		<servlet-name>ReloadFlyway</servlet-name>
		<url-pattern>/ReloadFlyway</url-pattern>
	</servlet-mapping>
	<servlet-mapping>
		<servlet-name>ReloadDBConnection</servlet-name>
		<url-pattern>/ReloadDBConnection</url-pattern>
	</servlet-mapping>

	<!-- /////////// -->
	<!-- Miscellaneous -->
	<session-config>
		<!-- 3 horas (180 minutos) -->
		<session-timeout>180</session-timeout>
	</session-config>

	<!-- MIME mapping -->
	<mime-mapping>
		<extension>doc</extension>
		<mime-type>application/vnd.ms-word</mime-type>
	</mime-mapping>
	<mime-mapping>
		<extension>gif</extension>
		<mime-type>image/gif</mime-type>
	</mime-mapping>
	<mime-mapping>
		<extension>htm</extension>
		<mime-type>text/html</mime-type>
	</mime-mapping>
	<mime-mapping>
		<extension>html</extension>
		<mime-type>text/html</mime-type>
	</mime-mapping>
	<mime-mapping>
		<extension>jnlp</extension>
		<mime-type>application/x-java-jnlp-file</mime-type>
	</mime-mapping>
	<mime-mapping>
		<extension>jpeg</extension>
		<mime-type>image/jpeg</mime-type>
	</mime-mapping>
	<mime-mapping>
		<extension>jpg</extension>
		<mime-type>image/jpeg</mime-type>
	</mime-mapping>
	<mime-mapping>
		<extension>js</extension>
		<mime-type>text/javascript</mime-type>
	</mime-mapping>
	<mime-mapping>
		<extension>pdf</extension>
		<mime-type>application/pdf</mime-type>
	</mime-mapping>
	<mime-mapping>
		<extension>png</extension>
		<mime-type>image/png</mime-type>
	</mime-mapping>
	<mime-mapping>
		<extension>rar</extension>
		<mime-type>application/x-rar-compressed</mime-type>
	</mime-mapping>
	<mime-mapping>
		<extension>txt</extension>
		<mime-type>text/plain</mime-type>
	</mime-mapping>
	<mime-mapping>
		<extension>xls</extension>
		<mime-type>application/vnd.ms-excel</mime-type>
	</mime-mapping>
	<mime-mapping>
		<extension>xml</extension>
		<mime-type>text/xml</mime-type>
	</mime-mapping>
	<mime-mapping>
		<extension>xul</extension>
		<mime-type>application/vnd.mozilla.xul-xml</mime-type>
	</mime-mapping>
	<mime-mapping>
		<extension>zhtml</extension>
		<mime-type>text/html</mime-type>
	</mime-mapping>
	<mime-mapping>
		<extension>zip</extension>
		<mime-type>application/x-zip</mime-type>
	</mime-mapping>
	<mime-mapping>
		<extension>zul</extension>
		<mime-type>text/html</mime-type>
	</mime-mapping>

	<welcome-file-list>
		<welcome-file>index.zul</welcome-file>
	</welcome-file-list>
</web-app>
