<?xml version="1.0" encoding="UTF-8"?>
<web-app xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://java.sun.com/xml/ns/javaee" xmlns:web="http://java.sun.com/xml/ns/javaee/web-app_2_5.xsd" xsi:schemaLocation="http://java.sun.com/xml/ns/javaee http://java.sun.com/xml/ns/javaee/web-app_2_5.xsd" id="WebApp_ID" version="2.5">
  <display-name>beerV1</display-name>

<!-- Login Configurations-->
<login-config>
	<auth-method>FORM</auth-method>
	<form-login-config>
		<form-login-page>/loginPage.html</form-login-page>
		<form-error-page>/loginError.html</form-error-page>
	</form-login-config>
</login-config>
<!-- Login Configurations-->
  
  
<!-- Welcome files Configuration -->
<welcome-file-list>
    <welcome-file>include.html</welcome-file>
    <welcome-file>index.html</welcome-file>
    <welcome-file>index.htm</welcome-file>
    <welcome-file>index.jsp</welcome-file>
    <welcome-file>default.html</welcome-file>
    <welcome-file>default.htm</welcome-file>
    <welcome-file>default.jsp</welcome-file>
  </welcome-file-list>
<!-- Searches for specific file in the location as per the above specified order. 
the first existing file in this order will always wins.  -->


<!-- Jsp Files Configuration -->  
<jsp-config>
  	<jsp-property-group>
  		<url-pattern>*.jsp</url-pattern>
  		<scripting-invalid>true</scripting-invalid>
		<el-ignored>true</el-ignored>
  	</jsp-property-group>
</jsp-config> 
<!-- Mind you, that the above configuration enables both the scripting and EL -->


<!-- Session Configuration -->
<session-config>
	<session-timeout>30</session-timeout>
</session-config>
<!-- Session Configured to be expired after 30 minutes of inactivity -->


<!-- Context Parameters -->
<context-param>
	<param-name>adminid</param-name>
	<param-value>ashok.babu</param-value>
</context-param>
<context-param>
	<param-name>admin-name</param-name>
	<param-value>ashok</param-value>
</context-param>
<!-- Parameters for entire web application -->


<!-- Listener Classes -->
<listener>
  	<listener-class>com.example.listener.MyServletContextListener</listener-class>
</listener>
<listener>
	<listener-class>com.example.listener.MyServletContextAttributeListener</listener-class>
</listener>
<listener>
	<listener-class>com.example.listener.MyHttpSessionListener</listener-class>
</listener>
<listener>
	<listener-class>com.example.listener.MyHttpSessionAttributeListener</listener-class>
</listener>
<listener>
	<listener-class>com.example.listener.MyServletRequestListener</listener-class>
</listener>
<listener>
	<listener-class>com.example.listener.MyServletRequestAttributeListener</listener-class>
</listener> 
<!-- Note: Both My HttpSessionBinding Listener and HttpSessionActivation Listener are not listed. 
Make sure all the Listener classes are properly constructed and deployed. -->



<!-- Servlet Configuration -->
<servlet>
	<security-role-ref>
		<role-name>Manager</role-name>
		<role-link>Admin</role-link>
	</security-role-ref>
    <init-param>
    	<param-name>mailid</param-name>
    	<param-value>askibabu</param-value>
    </init-param>
	<servlet-name>Ch3 Beer</servlet-name>
	<servlet-class>com.example.web.BeerSelect</servlet-class>
	<load-on-startup>1</load-on-startup>
</servlet>
<!-- Exact Match -->
<servlet-mapping>
	<servlet-name>Ch3 Beer</servlet-name>
	<url-pattern>/SelectBeer.do</url-pattern>
</servlet-mapping>
<!-- Directory Match -->
<servlet-mapping>
	<servlet-name>Ch3 Beer</servlet-name>
	<url-pattern>/SelectBeer/*</url-pattern>
</servlet-mapping>
<!-- Extension Match -->
<servlet-mapping>
	<servlet-name>Ch3 Beer</servlet-name>
	<url-pattern>*.do</url-pattern>
</servlet-mapping>
<!-- End of Servlet Configuration -->


<!-- Filter Mapping -->
<filter>
	<filter-name>Beer-Filter</filter-name>
	<filter-class>com.example.filter.MyFilter</filter-class>
</filter>
<filter-mapping>
	<filter-name>Beer-Filter</filter-name>
	<url-pattern>*.do</url-pattern>
</filter-mapping> 
<filter-mapping>
	<filter-name>Beer-Filter</filter-name>
	<servlet-name>Ch3 Beer</servlet-name>
	<dispatcher>REQUEST</dispatcher>
	<dispatcher>INCLUDE</dispatcher>
	<dispatcher>FORWARD</dispatcher>
	<dispatcher>ERROR</dispatcher>
</filter-mapping> -->
<!-- Filter Mapping -->


<!-- Error Pages -->
<error-page>
	<exception-type>java.lang.Throwable</exception-type>
	<location>/errorPage.jsp</location>
</error-page>
<error-page>
	<exception-type>java.lang.ArithmeticException</exception-type>
	<location>/arithErrorPage.jsp</location>
</error-page>
<error-page>
	<error-code>404</error-code>
	<location>/pageNotFound.jsp</location> 
</error-page>
<!-- Error Pages -->


<!--  Security Configurations -->
<security-constraint>
	<web-resource-collection>
		<web-resource-name>constraint</web-resource-name>
		<url-pattern>/Select.do</url-pattern>
		<http-method>GET</http-method> 
	</web-resource-collection>
	<auth-constraint>
		<role-name>Admin</role-name>
	</auth-constraint>
	<user-data-constraint>
		<transport-guarantee>NONE</transport-guarantee>
	</user-data-constraint>
</security-constraint>

<security-role>
	<role-name>Admin</role-name>
</security-role>
<!--  Security Configurations -->


<!--  Mime Mappings -->
<mime-mapping>
	<extension>jpg</extension>
	<mime-type>application/xml</mime-type>
</mime-mapping> 
<!--  Mime Mappings -->


<!-- Local EJB -->
<!-- <ejb-local-ref>
	<ejb-ref-name>customer</ejb-ref-name>
	<ejb-ref-type>Entity</ejb-ref-type>
	<local-home>com.smart.customer</local-home>
	<local>com.smart.customer</local>
</ejb-local-ref> -->
<!-- Local EJB -->


<!-- REMOTE Bean EJB -->
<!-- <ejb-ref>
	<ejb-ref-name>customer</ejb-ref-name>
	<ejb-ref-type>Entity</ejb-ref-type>
	<home>com.smart.customer</home>
	<remote>com.smart.customer</remote>
</ejb-ref> -->
<!-- REMOTE BEAN EJB -->

<!--  JNDI  -->
<env-entry>
	<env-entry-name>discountRate</env-entry-name>
	<env-entry-type>java.lang.Integer</env-entry-type>
	<env-entry-value>10</env-entry-value>
</env-entry>
<!--  JNDI  -->

</web-app>
