<?xml version="1.0"?>
<web-app 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_2_5.xsd" version="2.5">

	<display-name>xxx-web</display-name>
	<description></description>

	<context-param>
		<param-name>error-page</param-name>
		<param-value>/error.iface</param-value>
	</context-param>

	<!--
		State saving method: "client" or "server" (= default) See JSF
		Specification 2.5.2
	-->
	<context-param>
		<param-name>javax.faces.STATE_SAVING_METHOD</param-name>
		<param-value>server</param-value>
	</context-param>


	<!-- definicje lokalnych tagow -->
	<context-param>
		<param-name>facelets.LIBRARIES</param-name>
		<param-value>/WEB-INF/xxx.taglib.xml</param-value>
	</context-param>

	<context-param>
    <param-name>com.icesoft.faces.uploadMaxFileSize</param-name>
    <param-value>10485760</param-value>
  </context-param>

	<!-- Facelet Config  -->
	<!-- FOR PRODUCTION MODE SET FALSE!-->
	<context-param>
		<param-name>facelets.DEVELOPMENT</param-name>
		<param-value>true</param-value>
	</context-param>

	<context-param>
		<param-name>javax.faces.DEFAULT_SUFFIX</param-name>
		<param-value>.jspx</param-value>
	</context-param>

	<!--
		When enabled, users will see an hourglass cursor and be prevented from interacting with the user-interface with the
		mouse
	-->
	<context-param>
		<param-name>com.icesoft.faces.blockUIOnSubmit</param-name>
		<param-value>true</param-value>
	</context-param>

	<!-- FOR PRODUCTION MODE set '-1' to disable reloading of templates! -->
	<context-param> 
	  <param-name>facelets.REFRESH_PERIOD</param-name>
	  <param-value>2</param-value> 
	</context-param>
	
	<!-- FOR PRODUCTION MODE set '-1' to disable looking for modification every xx seconds! -->
	<context-param>
		<param-name>com.icesoft.faces.reloadInterval</param-name>
		<param-value>10</param-value>
	</context-param>
	
	<!--
		Set this flag to true, if you want the JavaServer Faces Reference Implementation to validate the XML in your
		faces-config.xml resources against the DTD. Default value is false.
	-->
	<context-param>
		<param-name>com.sun.faces.validateXml</param-name>
		<param-value>false</param-value>
	</context-param>

	<!--
		Set this flag to true, if you want the JavaServer Faces Reference Implementation to verify that all of the application
		objects you have configured (components, converters, renderers, and validators) can be successfully created. Default
		value is false.
	-->
	<context-param>
		<param-name>com.sun.faces.verifyObjects</param-name>
		<param-value>false</param-value>
	</context-param>

	<!-- End of Facelet Config  -->

	<context-param>
		<param-name>com.icesoft.faces.standardRequestScope</param-name>
		<param-value>false</param-value>
	</context-param>

	<context-param>
		<param-name>com.icesoft.faces.debugDOMUpdate</param-name>
		<param-value>false</param-value>
	</context-param>

	<context-param>
		<param-name>com.icesoft.faces.compressResources</param-name>
		<param-value>false</param-value>
	</context-param>

	<context-param>
		<param-name>com.icesoft.faces.uploadDirectory</param-name>
		<param-value>upload</param-value>
	</context-param>
  
  <!-- Remove 'WARN UploadServer: File upload issue' -->
  <context-param>
    <param-name>com.icesoft.faces.uploadDirectoryAbsolute</param-name>
    <param-value>true</param-value>
  </context-param>

	<!--
		Specifies to the ICEfaces framework whether to support multiple views of a single application from the same browser.
		When running in a Portlet environment, this parameter must be set to true.
	-->
	<context-param>
		<param-name>com.icesoft.faces.concurrentDOMViews</param-name>
		<param-value>false</param-value>
	</context-param>

	<!--
		Specifies to the ICEfaces framework that synchronous update mode is to be used. By default, ICEfaces uses asynchronous
		update mode to support server-initiated updates (AJAX push). Setting to true will enable synchronous update mode and
		disable AJAX push features.
	-->
	<context-param>
		<param-name>com.icesoft.faces.synchronousUpdate</param-name>
		<param-value>false</param-value>
	</context-param>

	<!--
		Specifies to the ICEfaces framework whether to compress the server-side DOM representation after each response. This
		saves a considerable amount of of memory per client. However, since this is decompressed/compressed for every update,
		it may not bring significant memory savings to applications that make frequent use of AJAX push. 
		<context-param> <param-name>com.icesoft.faces.compressDOM</param-name> <param-value>true</param-value> </context-param>
	-->

	<!--
		Specifies the amount of time in milliseconds that the bridge will wait for a response from the server for a
		user-initiated request before declaring the connection lost. Un-comment and change the default value 60000, if necessary.-->
		<context-param>
			<param-name>com.icesoft.faces.connectionTimeout</param-name>
			<param-value>900000</param-value>
		</context-param>
	
		
		<context-param>
			<param-name>com.icesoft.faces.blockingRequestHandler</param-name>
			<param-value>icefaces</param-value>
		</context-param>

	<!--
		Specifies the amount of time in milliseconds that an idle asynchronous blocking connection should be held open before
		being released. Normally, the blocking connection is closed and re-opened with every communication to the browser,
		such as user interaction or a heartbeat ping. The purpose of this setting is to remove the possibility of threads
		being held blocked for a long duration on a dead or completely inactive client connection. This value should be longer
		than the heartbeat interval to avoid unnecessary network traffic. Un-comment and change the default value 90000, 
		if necessary. 
		<context-param> 
		  <param-name>com.icesoft.faces.blockingConnectionTimeout</param-name>
		  <param-value>60000</param-value> 
		</context-param>
	-->

	<!--
		Specifies the amount of time in milliseconds between heartbeat messages. Un-comment and change the default value 50000, 
		if necessary. 
	  <context-param> 
	    <param-name>com.icesoft.faces.heartbeatInterval</param-name>
		  <param-value>30000</param-value> 
		</context-param>
	-->

	<!--
		Specifies how many consecutive heartbeat connection attempts may fail before the connection is considered lost.
		Un-comment and change the default value 3, if necessary. -->
		<context-param>
		  <param-name>com.icesoft.faces.heartbeatRetries</param-name> 
		  <param-value>20</param-value> 
		</context-param>
	

	<!--
		Specifies the number of milliseconds that a heartbeat request waits for a successful response before it is considered
		timed out. Un-comment and change the default value 30000, if necessary. Oczekiwanie na koniec transakcji 
		<context-param>
		  <param-name>com.icesoft.faces.heartbeatTimeout</param-name> 
		  <param-value>450000</param-value> 
		</context-param>
	-->

	<!--
		Specifies a page URI to redirect the client to when an asynchronous connection is lost. The parameter value must be
		surrounded by single quotes. Un-comment and change the default value, if necessary.
	-->
	<context-param>
		<param-name>com.icesoft.faces.connectionLostRedirectURI</param-name>
		<param-value>'closed.jsp?connectionLost'</param-value>
	</context-param>

	<context-param>
		<param-name>com.icesoft.faces.sessionExpiredRedirectURI</param-name>
		<param-value>'closed.jsp?sessionExpired'</param-value>
	</context-param>

	<!--
		ConfigureListener is not generally required. Due to an apparent bug in Tomcat users have reported seeing the following
		error "SEVERE: ICEfaces could not initialize JavaServer Faces. Please check that the JSF .jar files are installed
		correctly.". Specifying the ConfigureListener resolves the issue. <listener>
		<listener-class>com.sun.faces.config.ConfigureListener</listener-class> </listener>
	-->

	<listener>
		<listener-class>org.springframework.web.context.ContextLoaderListener</listener-class>
	</listener>

	<listener>
		<listener-class>com.icesoft.faces.util.event.servlet.ContextEventRepeater</listener-class>
	</listener>

	<!-- file upload Servlet -->
	<servlet>
		<servlet-name>uploadServlet</servlet-name>
		<servlet-class>com.icesoft.faces.component.inputfile.FileUploadServlet</servlet-class>
		<load-on-startup>1</load-on-startup>
	</servlet>


	<!-- Faces Servlet , konfiguracja standardowa-->
	<servlet>
		<servlet-name>Faces Servlet</servlet-name>
		<servlet-class>javax.faces.webapp.FacesServlet</servlet-class>
		<load-on-startup>1</load-on-startup>
	</servlet>

	<servlet>
		<servlet-name>Persistent Faces Servlet</servlet-name>
		<servlet-class>com.icesoft.faces.webapp.xmlhttp.PersistentFacesServlet</servlet-class>
		<load-on-startup>1</load-on-startup>
	</servlet>

	<servlet>
		<servlet-name>Blocking Servlet</servlet-name>
		<servlet-class>com.icesoft.faces.webapp.xmlhttp.BlockingServlet</servlet-class>
		<load-on-startup>1</load-on-startup>
	</servlet>


	<!--
		<servlet> <servlet-name>Tomcat Push Servlet</servlet-name>
		<servlet-class>com.icesoft.faces.webapp.http.servlet.TomcatPushServlet</servlet-class>
		<load-on-startup>1</load-on-startup> </servlet>
	-->

	<!-- extension mapping -->

	<servlet-mapping>
		<servlet-name>Persistent Faces Servlet</servlet-name>
		<url-pattern>*.iface</url-pattern>
		<!--url-pattern>*.jspx</url-pattern-->
		<url-pattern>/xmlhttp/* </url-pattern>
	</servlet-mapping>

	<servlet-mapping>
		<servlet-name>Blocking Servlet</servlet-name>
		<url-pattern>/block/*</url-pattern>
	</servlet-mapping>

	<!--
		<servlet-mapping> <servlet-name>Tomcat Push Servlet</servlet-name>
		<url-pattern>/block/receive-updated-views/*</url-pattern> </servlet-mapping>
	-->
		
	<session-config>
		<session-timeout>120</session-timeout>
	</session-config>

	<!-- Welcome files -->
	<welcome-file-list>
		<welcome-file>index.jsp</welcome-file>
		<welcome-file>index.html</welcome-file>
		<!--welcome-file>index.jspx</welcome-file-->
	</welcome-file-list>


	<!-- Define roles -->

 	<security-role>
		<role-name>ADMIN</role-name>
 	</security-role>

	<security-constraint>
		<web-resource-collection>
			<web-resource-name>Protected Area</web-resource-name>
         <url-pattern>*.jspx</url-pattern>
    </web-resource-collection>
		<auth-constraint>
			<role-name>ADMIN</role-name>
		</auth-constraint>
	</security-constraint>

	<login-config>
		<!--auth-method>FORM</auth-method-->
		<form-login-config> 
			<form-login-page>/login.jsp</form-login-page>
			<form-error-page>/login.jsp?retry=true</form-error-page>
		</form-login-config>
	</login-config>

	<error-page>
		<exception-type>javax.faces.FacesException</exception-type>
		<location>/error.iface</location>
	</error-page>

	<error-page>
		<exception-type>java.lang.Throwable</exception-type>
		<location>/error.iface</location>
	</error-page>

	<error-page>
		<error-code>408</error-code>
		<location>/closed.jsp</location>
	</error-page>

	<error-page>
		<error-code>403</error-code>
		<location>/accden.jsp</location>
	</error-page>

	<error-page>
		<error-code>400</error-code>
		<location>/logout.jsp</location>
	</error-page>

</web-app>
