<?xml version="1.0"?>

<!DOCTYPE web-app PUBLIC
  "-//Sun Microsystems, Inc.//DTD Web Application 2.3//EN"
  "http://java.sun.com/dtd/web-app_2_3.dtd">

<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">

	<description>GVC</description>
	
    <!-- Tiles ViewHandler config file -->    
    <context-param>
    	<param-name>tiles-definitions</param-name>
    	<param-value>/WEB-INF/tiles.xml</param-value>
    	<description>
    	Tiles configuration
         definition files and a listener need to be defined.
         the listener will initialize JspTilesViewHandlerImpl with tiles definitions.
    	</description>
    </context-param>

    <context-param>
        <param-name>javax.faces.CONFIG_FILES</param-name>
        <param-value>
            /WEB-INF/faces-config.xml
        </param-value>
        <description>
	        /WEB-INF/faces-config.xml,/WEB-INF/faces-config2.xml
			Se for criar outros arquivos para mapeamento
        </description>
    </context-param>

    <context-param>
        <param-name>javax.faces.STATE_SAVING_METHOD</param-name>
        <param-value>client</param-value>
        <description>
            State saving method: "client" or "server" (= default)
            See JSF Specification 2.5.2. Important to ADF.
        </description>
    </context-param>

    <context-param>
        <param-name>org.apache.myfaces.ALLOW_JAVASCRIPT</param-name>
        <param-value>true</param-value>
        <description>
            This parameter tells MyFaces if javascript code should be allowed in the
            rendered HTML output.
            If javascript is allowed, command_link anchors will have javascript code
            that submits the corresponding form.
            If javascript is not allowed, the state saving info and nested parameters
            will be added as url parameters.
            Default: "true"
        </description>
    </context-param>

    <context-param>
        <param-name>org.apache.myfaces.DETECT_JAVASCRIPT</param-name>
        <param-value>false</param-value>
    </context-param>

    <context-param>
        <param-name>org.apache.myfaces.PRETTY_HTML</param-name>
        <param-value>true</param-value>
        <description>
            If true, rendered HTML code will be formatted, so that it is "human readable".
            i.e. additional line separators and whitespace will be written, that do not
            influence the HTML code.
            Default: "true"
        </description>
    </context-param>

    <context-param>
        <param-name>org.apache.myfaces.AUTO_SCROLL</param-name>
        <param-value>true</param-value>
        <description>
            If true, a javascript function will be rendered that is able to restore the
            former vertical scroll on every request. Convenient feature if you have pages
            with long lists and you do not want the browser page to always jump to the top
            if you trigger a link or button action that stays on the same page.
            Default: "false"
        </description>
    </context-param>
    
	<!-- Filter -->
	<filter>
		<filter-name>ExtensionsFilter</filter-name>
		<filter-class>org.apache.myfaces.component.html.util.ExtensionsFilter</filter-class>
		<init-param>
			<param-name>uploadMaxFileSize</param-name>
			<param-value>10g</param-value>
			<description>Set the size limit for uploaded files.
                Format: 10 - 10 bytes
                        10k - 10 KB
                        10m - 10 MB
                        1g - 1 GB</description>
		</init-param>
		<init-param>
			<param-name>uploadThresholdSize</param-name>
			<param-value>100k</param-value>
			<description>Set the threshold size - files
                    below this limit are stored in memory, files above
                    this limit are stored on disk.

                Format: 10 - 10 bytes
                        10k - 10 KB
                        10m - 10 MB
                        1g - 1 GB</description>
		</init-param>
	</filter>
	<filter>
		<filter-name>LoginFilter</filter-name>
		<filter-class>gvc.LoginFilter</filter-class>
	</filter>
    <filter>
        <filter-name>AjaxAnywhere</filter-name>
        <filter-class>org.ajaxanywhere.AAFilter</filter-class>
        <init-param>
            <param-name>preSendHandlerClass</param-name>
            <param-value>org.ajaxanywhere.jsf.MyFacesClientStateSavingPreSendHandler</param-value>
            <!--<param-value>org.ajaxanywhere.jsf.JSFRIClientStateSavingPreSendHandler</param-value>-->
        </init-param>
    </filter>

    <filter-mapping>
        <filter-name>AjaxAnywhere</filter-name>
        <url-pattern>*.jsf</url-pattern>
    </filter-mapping>
    <filter-mapping>
        <filter-name>AjaxAnywhere</filter-name>
        <url-pattern>*.jsp</url-pattern>
    </filter-mapping>

	<filter-mapping>
		<filter-name>LoginFilter</filter-name>
		<url-pattern>*.jsf</url-pattern>
	</filter-mapping>
	
	<filter-mapping>
		<filter-name>ExtensionsFilter</filter-name>
		<url-pattern>*.jsf</url-pattern>
	</filter-mapping>
	<filter-mapping>
		<filter-name>ExtensionsFilter</filter-name>
		<url-pattern>/faces/*</url-pattern>
	</filter-mapping>
    
	
	<!-- Se for rodar direto do workspace do eclipse -->
	<listener>
		<listener-class>org.apache.myfaces.webapp.StartupServletContextListener</listener-class>
	</listener>
	
    <!-- Servlet -->
    <servlet>
        <servlet-name>FacesServlet</servlet-name>
        <servlet-class>javax.faces.webapp.FacesServlet</servlet-class>
        <load-on-startup>1</load-on-startup>
    </servlet>

	<servlet>
		<servlet-name>Jenia internal servlet</servlet-name>
		<servlet-class>org.jenia.faces.util.Servlet</servlet-class>
		<load-on-startup>2</load-on-startup>
	</servlet>

	<!-- Servlet Mapping -->
    <servlet-mapping>
        <servlet-name>FacesServlet</servlet-name>
        <url-pattern>*.jsf</url-pattern>
    </servlet-mapping>
    
	<servlet-mapping>
		<servlet-name>Jenia internal servlet</servlet-name>
		<url-pattern>/jenia4faces/*</url-pattern>
	</servlet-mapping>
	
	<session-config>
		<session-timeout>15</session-timeout> 
	</session-config>
	
    <!-- Welcome files -->
    <welcome-file-list>
        <welcome-file>index.jsp</welcome-file>
        <welcome-file>index.html</welcome-file>
    </welcome-file-list>

</web-app>
