<?xml version="1.0" encoding="UTF-8"?>
<beans xmlns="http://www.springframework.org/schema/beans"
	    xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
	    xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans.xsd">

	<bean id="compositeFilter" class="com.casic.PgInterface.core.servlet.CompositeFilter">
		<property name="filters">
			<list>
                <!--<ref bean="authFilter"/>-->
				<ref bean="characterEncodingFilter"/>
				<ref bean="acceptLanguageHeaderFilter"/>
				<ref bean="openSessionInViewFilter"/>
				<ref bean="restFilter"/>
				<!--<ref bean="servletFilter"/>-->
			</list>
		</property>
	</bean>

	<bean id="characterEncodingFilter" class="com.casic.PgInterface.core.servlet.ProxyFilter">
		<property name="name" value="encode"/>
		<property name="filter">
			<bean class="org.springframework.web.filter.CharacterEncodingFilter">
				<property name="encoding" value="UTF-8"/>
				<property name="forceEncoding" value="true"/>
			</bean>
		</property>
	</bean>

	<bean id="acceptLanguageHeaderFilter" class="com.casic.PgInterface.core.servlet.ProxyFilter">
		<property name="name" value="i18n"/>
		<property name="filter">
			<bean class="com.casic.PgInterface.core.i18n.AcceptLanguageHeaderFilter"/>
		</property>
	</bean>

    <bean id="authFilter" class="com.casic.PgInterface.core.servlet.ProxyFilter">
        <property name="name" value="auth"/>
        <property name="filter">
            <bean class="com.casic.PgInterface.core.auth.AuthFilter"/>
        </property>
        <property name="excludePatterns">
            <list>
                <value>/s/*</value>
                <value>/login.jsp</value>
                <value>/user/user-info-login.do</value>
            </list>
        </property>
    </bean>

	<bean id="openSessionInViewFilter" class="com.casic.PgInterface.core.servlet.ProxyFilter">
		<property name="name" value="hibernate"/>
		<property name="filter">
			<bean class="org.springframework.orm.hibernate4.support.OpenSessionInViewFilter"/>
		</property>
		<property name="excludePatterns" value="/common/util/*"/>
	</bean>

	<bean id="restFilter" class="com.casic.PgInterface.core.servlet.ProxyFilter">
		<property name="name" value="rest"/>
		<property name="filter">
			<bean class="com.casic.PgInterface.core.ext.rest.RestFilter"/>
		</property>
		<property name="urlPattern" value="/rs/*"/>
	</bean>

	<bean id="servletFilter" class="com.casic.PgInterface.core.servlet.ServletFilter">
		<property name="name" value="servlet"/>
		<property name="servletMap">
			<map>
				<entry key="*.do">
					<ref bean="springmvc"/>
				</entry>
			</map>
		</property>
	</bean>

	<bean id="springmvc" class="com.casic.PgInterface.core.servlet.ProxyServlet">
        <constructor-arg index="0" value="springmvc"/>
		<constructor-arg index="1">
			<bean class="org.springframework.web.servlet.DispatcherServlet"/>
		</constructor-arg>
	</bean>

</beans>
