struts-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Marc <ruch...@gmx.de>
Subject Re: File Upload size restriction ??
Date Mon, 30 Jun 2003 09:21:30 GMT
Uups,

found the answer in one of the strus-examples.

Here it is for those who are interested.

Regards

Markus




  /**
      * Check to make sure the client hasn't exceeded the maximum 
allowed upload size inside of this
      * validate method.
      */
     public ActionErrors validate(ActionMapping mapping, 
HttpServletRequest request)
     {
         ActionErrors errors = null;
         //has the maximum length been exceeded?
         Boolean maxLengthExceeded = (Boolean)
 
request.getAttribute(MultipartRequestHandler.ATTRIBUTE_MAX_LENGTH_EXCEEDED);
         if ((maxLengthExceeded != null) && 
(maxLengthExceeded.booleanValue()))
         {
             errors = new ActionErrors();
             errors.add(ERROR_PROPERTY_MAX_LENGTH_EXCEEDED, new 
ActionError("maxLengthExceeded"));
         }
         return errors;

     }



---------------------------------------------------------------------
To unsubscribe, e-mail: struts-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: struts-user-help@jakarta.apache.org


Mime
View raw message