nl.gx.webmanager.handler.forms.validation
Class FileSizeFormPartValidator
java.lang.Object
nl.gx.webmanager.handler.forms.validation.FileSizeFormPartValidator
- All Implemented Interfaces:
- FormComponent, Validator
public class FileSizeFormPartValidator
- extends java.lang.Object
- implements Validator
Checks if the size of a file does not exceed the maximum file size.
| Parameter name |
Mode |
Default value |
Description |
| wmformpart |
Parameter |
Required |
- |
The formpart to validate (a file). |
| maxfilesize |
Parameter |
Optional |
1000000 (=1MB) |
The maximum filesize of file in bytes. |
| filetoolarge |
Message |
- |
- |
If the file size is bigger than the maximum allowed file size. |
Example usage:
- Maximum file size of file uploads.
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
MSG_FILETOOLARGE
public static final java.lang.String MSG_FILETOOLARGE
- See Also:
- Constant Field Values
FileSizeFormPartValidator
public FileSizeFormPartValidator()
init
public void init(FormComponentConfig c)
throws InitializationException
- Description copied from interface:
FormComponent
- Passes the initialization parameters to the component.
- Specified by:
init in interface FormComponent
- Parameters:
c - The FormComponentConfig object that contains
configutation information for this component.
- Throws:
InitializationException - If initialization failed
validate
public ValidatorMessage[] validate(FormDefinition form,
State formState,
javax.servlet.http.HttpServletRequest req,
javax.servlet.http.HttpServletResponse res)
- Performs validation on a form.
- Specified by:
validate in interface Validator
- Parameters:
form - The form that should be validatedformState - The state of the currently handled formreq - The http servlet requestres - The http servlet response
- Returns:
- The array of validator messages, containing validation errors for the form.
Copyright © 2007-2011 GX Software BV. All Rights Reserved.