<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE struts PUBLIC
"-//Apache Software Foundation//DTD Struts Configuration 2.0//EN"
"http://struts.apache.org/dtds/struts-2.0.dtd">


<struts>
	<constant name="struts.devMode" value="true" />
 	<constant name="struts.custom.i18n.resources" value="global" />
 
	<package name="p1"  extends="struts-default">
 
	<action name="fileUploadPage" class="com.javaskool.MyFileUploadAction" method="display">
	    <result name="none">/uploadFile.jsp</result>
	</action>
 
	<action name="myfileUploadAction" class="com.javaskool.MyFileUploadAction">
	
	    	<interceptor-ref name="exception"/> <!-- Maps exceptions to a result.  -->	    	
	    	<interceptor-ref name="logger"/><!-- Outputs the name of the Action.  This interceptor logs the start and end of the execution an action (in English-only, not internationalized). -->
	    	<interceptor-ref name="i18n"/>  <!-- Remembers the locale selected for a user's session.  -->
            
            <interceptor-ref name="fileUpload"> <!-- An Interceptor that adds easy access to file upload support.  -->
		       		<param name="allowedTypes">text/plain,,image/png,image/bmp,image/jpeg</param>
		       		<param name="maximumSize">10240</param> <!-- 10KB only -->
		  	 </interceptor-ref>
		  	  
		  	 <!-- including interceptor and the defaultStack provided by vendor--> 
		  	 <!-- Sets the request parameters onto the Action.  -->
		  	 <!-- dojo..* (anything parameter whose name contains "dojo.") &  ^struts..* (any parameter whose name starts with "struts.")
		  	 
		  	 <param name="excludeParams">dojo..*,^struts..*,^session..*,^request..*,^application..*,^servlet(Request|Response)..*,parameters...*</param>
		  	 
		  	  -->
            <interceptor-ref name="params">
                <param name="excludeParams">dojo\..*,^struts\..*</param>
                
            </interceptor-ref>
            
            <!-- This interceptor does nothing if the name of the method being invoked is specified in the excludeMethods parameter.  -->
            <!-- Performs validation using the validators defined in action-validation.xml  -->
            <interceptor-ref name="validation">
                <param name="excludeMethods">input,back,cancel,browse</param>
            </interceptor-ref>
            
            <!-- In this case input,back,cancel, as well as browse of the action class will not pass through the workflow process -->
           	<!-- Calls the validate method in your Action class. If Action errors are created then it returns the INPUT view.  -->
            <interceptor-ref name="workflow">
                <param name="excludeMethods">input,back,cancel,browse</param>
            </interceptor-ref>
  
	    <result name="success">/success.jsp</result>
	    <result name="input">/uploadFile.jsp</result>
</action>
</package>

</struts>



<!-- 
This interceptor can be forced to ignored parameters, by setting its excludeParams attribute. This attribute accepts a comma separated list of regular expressions. When any of these expressions match the name of a parameter, such parameter will be ignored by the interceptor. Interceptor stacks defined by Struts already exclude some parameters:

    dojo\..* (anything parameter whose name contains "dojo.")
    ^struts\..* (any parameter whose name starts with "struts.")

This interceptor runs the action through the standard validation framework, which in turn checks the action against any validation rules (found in files such as ActionClass-validation.xml) and adds field-level and action-level error messages (provided that the action implements com.opensymphony.xwork2.ValidationAware). This interceptor is often one of the last (or second to last) interceptors applied in a stack, as it assumes that all values have already been set on the action.

This interceptor does nothing if the name of the method being invoked is specified in the excludeMethods parameter. 

excludeMethods accepts a comma-delimited list of method names. For example, requests to foo!input.action and foo!back.action will be skipped by this interceptor if you set the excludeMethods parameter to "input, back".

Note that this has nothing to do with the com.opensymphony.xwork2.Validateable interface and simply adds error messages to the action. The workflow of the action request does not change due to this interceptor. Rather, this interceptor is often used in conjuction with the workflow interceptor.

 -->
