<?xml version="1.0" encoding="UTF-8"?>
<web-app
	id="BGERP"
	xmlns="http://xmlns.jcp.org/xml/ns/javaee"
	xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
	xsi:schemaLocation="http://xmlns.jcp.org/xml/ns/javaee http://xmlns.jcp.org/xml/ns/javaee/web-app_4_0.xsd"
	version="4.0">
	<display-name>BGERP</display-name>

	<filter>
		<filter-name>SetCharacterEncodingFilter</filter-name>
		<filter-class>org.bgerp.app.servlet.filter.SetCharacterEncodingFilter</filter-class>
		<init-param>
			<param-name>encoding</param-name>
			<param-value>UTF-8</param-value>
		</init-param>
	</filter>
	<filter-mapping>
		<filter-name>SetCharacterEncodingFilter</filter-name>
		<url-pattern>*</url-pattern>
	</filter-mapping>

	<filter>
		<filter-name>AuthFilter</filter-name>
		<filter-class>org.bgerp.app.servlet.filter.AuthFilter</filter-class>
	</filter>
	<filter-mapping>
		<filter-name>AuthFilter</filter-name>
		<url-pattern>/login.do</url-pattern>
		<url-pattern>/user/*</url-pattern>
		<url-pattern>/admin/*</url-pattern>
		<url-pattern>/usermob/*</url-pattern>
	</filter-mapping>

	<filter>
		<filter-name>SetRequestParamsFilter</filter-name>
		<filter-class>ru.bgcrm.servlet.filter.SetRequestParamsFilter</filter-class>
	</filter>
	<filter-mapping>
		<filter-name>SetRequestParamsFilter</filter-name>
		<url-pattern>*.do</url-pattern>
		<dispatcher>REQUEST</dispatcher>
		<dispatcher>INCLUDE</dispatcher>
		<dispatcher>FORWARD</dispatcher>
	</filter-mapping>
	<filter-mapping>
		<filter-name>SetRequestParamsFilter</filter-name>
		<url-pattern>*.jsp</url-pattern>
		<dispatcher>REQUEST</dispatcher>
		<dispatcher>FORWARD</dispatcher>
	</filter-mapping>
	<filter-mapping>
		<filter-name>SetRequestParamsFilter</filter-name>
		<url-pattern>/open/*</url-pattern>
	</filter-mapping>

	<filter>
		<filter-name>OpenFilter</filter-name>
		<filter-class>org.bgerp.app.servlet.filter.OpenFilter</filter-class>
	</filter>
	<filter-mapping>
		<filter-name>OpenFilter</filter-name>
		<url-pattern>/open/*</url-pattern>
		<dispatcher>REQUEST</dispatcher>
	</filter-mapping>

	<!-- changed default configururation of JspServlet  -->
	<servlet>
		<servlet-name>jsp</servlet-name>
		<servlet-class>org.apache.jasper.servlet.JspServlet</servlet-class>
		<init-param>
			<param-name>fork</param-name>
			<param-value>false</param-value>
		</init-param>
		<!-- https://stackoverflow.com/questions/208736/strip-whitespace-from-jsp-output -->
		<init-param>
			<param-name>trimSpaces</param-name>
			<param-value>true</param-value>
		</init-param>
		<init-param>
			<param-name>compilerSourceVM</param-name>
			<param-value>11</param-value>
		</init-param>
		<init-param>
			<param-name>compilerTargetVM</param-name>
			<param-value>11</param-value>
		</init-param>
		<load-on-startup>3</load-on-startup>
	</servlet>

	<servlet>
		<servlet-name>action</servlet-name>
		<servlet-class>ru.bgcrm.servlet.ActionServlet</servlet-class>
		<load-on-startup>6</load-on-startup>
	</servlet>
	<servlet-mapping>
		<servlet-name>action</servlet-name>
		<url-pattern>*.do</url-pattern>
	</servlet-mapping>

	<servlet>
		<servlet-name>GetUpdatedAddressObjects</servlet-name>
		<servlet-class>org.bgerp.app.servlet.GetUpdatedAddressObjects</servlet-class>
	</servlet>
	<servlet-mapping>
		<servlet-name>GetUpdatedAddressObjects</servlet-name>
		<url-pattern>/getUpdatedAddressObjects</url-pattern>
	</servlet-mapping>

	<session-config>
		<session-timeout>5</session-timeout>
	</session-config>

	<listener>
		<listener-class>org.bgerp.app.servlet.user.SessionListener</listener-class>
	</listener>
</web-app>