I am using the file upload and I have the folloiwng issues and I do not know 
why this is happening. Whenever the file size exceeds the configured size no 
field error is set. Looking at the source code, if your action implements 
"Validation aware" interface, then it should be set. Since my action extends 
"ActionSupport", I should see thoes errors. However; I see the 
following message on the console. 
   
   the request was rejected because its size (11272430) exceeds the configured 
maximum (2097152)
Here is the code snnipet from"FileUploadInterceptor" that should set the field 
error:
    ValidationAware validation = null;
     if (action instanceof ValidationAware) {
        validation = (ValidationAware) action;
    }
    else if (maximumSize != null && maximumSize.longValue() < file.length()) {
        String errMsg = getTextMessage("struts.messages.error.file.too.large", 
new Object[]{inputName, file.getName(), "" + file.length()}, locale);
        if (validation != null) {
            validation.addFieldError(inputName, errMsg);
        }

The second issue is when I overwrite the maximum size, it ignores it and uses 
the struts default. Here is my action configuration:
<action name="newTicketSave" class="ccol.action.ticket.TicketCreation">
         <interceptor-ref name="AuthenticationInterceptor"/>
          <interceptor-ref name="EJB3LocalInterceptor"/>
         <interceptor-ref name="basicStack"/>
         <interceptor-ref name="fileUpload">
          <param name="maximumSize">4194304</param>
         </interceptor-ref>
          <interceptor-ref name="validation"/>
          <interceptor-ref name="workflow"/>
         <result name="input">newTicket</result>
            <result name="success">mainPage</result>
 </action>
I would appreciate any feedback on how to fix this.


      __________________________________________________________________
Ask a question on any topic and get answers from real people. Go to Yahoo! 
Answers and share what you know at http://ca.answers.yahoo.com

Reply via email to