Package org.springframework.web.bind
Class EscapedErrors
java.lang.Object
org.springframework.web.bind.EscapedErrors
- All Implemented Interfaces:
org.springframework.validation.Errors
Errors wrapper that adds automatic HTML escaping to the wrapped instance,
for convenient usage in HTML views. Can be retrieved easily via
RequestContext's
getErrors
method.
Note that BindTag does not use this class to avoid unnecessary creation of ObjectError instances. It just escapes the messages and values that get copied into the respective BindStatus instance.
- Since:
- 01.03.2003
- Author:
- Juergen Hoeller
- See Also:
-
org.springframework.web.servlet.support.RequestContext#getErrors
org.springframework.web.servlet.tags.BindTag
-
Field Summary
Fields inherited from interface org.springframework.validation.Errors
NESTED_PATH_SEPARATOR
-
Constructor Summary
ConstructorDescriptionEscapedErrors
(org.springframework.validation.Errors source) Create a new EscapedErrors instance for the given source instance. -
Method Summary
Modifier and TypeMethodDescriptionvoid
addAllErrors
(org.springframework.validation.Errors errors) List<org.springframework.validation.ObjectError>
int
org.springframework.validation.FieldError
org.springframework.validation.FieldError
getFieldError
(String field) int
int
getFieldErrorCount
(String field) List<org.springframework.validation.FieldError>
List<org.springframework.validation.FieldError>
getFieldErrors
(String field) Class<?>
getFieldType
(String field) getFieldValue
(String field) org.springframework.validation.ObjectError
int
List<org.springframework.validation.ObjectError>
org.springframework.validation.Errors
boolean
boolean
boolean
hasFieldErrors
(String field) boolean
void
void
pushNestedPath
(String subPath) void
void
void
void
rejectValue
(String field, String errorCode) void
rejectValue
(String field, String errorCode, Object[] errorArgs, String defaultMessage) void
rejectValue
(String field, String errorCode, String defaultMessage) void
setNestedPath
(String nestedPath)
-
Constructor Details
-
EscapedErrors
public EscapedErrors(org.springframework.validation.Errors source) Create a new EscapedErrors instance for the given source instance.
-
-
Method Details
-
getSource
public org.springframework.validation.Errors getSource() -
getObjectName
- Specified by:
getObjectName
in interfaceorg.springframework.validation.Errors
-
setNestedPath
- Specified by:
setNestedPath
in interfaceorg.springframework.validation.Errors
-
getNestedPath
- Specified by:
getNestedPath
in interfaceorg.springframework.validation.Errors
-
pushNestedPath
- Specified by:
pushNestedPath
in interfaceorg.springframework.validation.Errors
-
popNestedPath
- Specified by:
popNestedPath
in interfaceorg.springframework.validation.Errors
- Throws:
IllegalStateException
-
reject
- Specified by:
reject
in interfaceorg.springframework.validation.Errors
-
reject
- Specified by:
reject
in interfaceorg.springframework.validation.Errors
-
reject
- Specified by:
reject
in interfaceorg.springframework.validation.Errors
-
rejectValue
- Specified by:
rejectValue
in interfaceorg.springframework.validation.Errors
-
rejectValue
- Specified by:
rejectValue
in interfaceorg.springframework.validation.Errors
-
rejectValue
public void rejectValue(@Nullable String field, String errorCode, @Nullable Object[] errorArgs, @Nullable String defaultMessage) - Specified by:
rejectValue
in interfaceorg.springframework.validation.Errors
-
addAllErrors
public void addAllErrors(org.springframework.validation.Errors errors) - Specified by:
addAllErrors
in interfaceorg.springframework.validation.Errors
-
hasErrors
public boolean hasErrors()- Specified by:
hasErrors
in interfaceorg.springframework.validation.Errors
-
getErrorCount
public int getErrorCount()- Specified by:
getErrorCount
in interfaceorg.springframework.validation.Errors
-
getAllErrors
- Specified by:
getAllErrors
in interfaceorg.springframework.validation.Errors
-
hasGlobalErrors
public boolean hasGlobalErrors()- Specified by:
hasGlobalErrors
in interfaceorg.springframework.validation.Errors
-
getGlobalErrorCount
public int getGlobalErrorCount()- Specified by:
getGlobalErrorCount
in interfaceorg.springframework.validation.Errors
-
getGlobalErrors
- Specified by:
getGlobalErrors
in interfaceorg.springframework.validation.Errors
-
getGlobalError
@Nullable public org.springframework.validation.ObjectError getGlobalError()- Specified by:
getGlobalError
in interfaceorg.springframework.validation.Errors
-
hasFieldErrors
public boolean hasFieldErrors()- Specified by:
hasFieldErrors
in interfaceorg.springframework.validation.Errors
-
getFieldErrorCount
public int getFieldErrorCount()- Specified by:
getFieldErrorCount
in interfaceorg.springframework.validation.Errors
-
getFieldErrors
- Specified by:
getFieldErrors
in interfaceorg.springframework.validation.Errors
-
getFieldError
@Nullable public org.springframework.validation.FieldError getFieldError()- Specified by:
getFieldError
in interfaceorg.springframework.validation.Errors
-
hasFieldErrors
- Specified by:
hasFieldErrors
in interfaceorg.springframework.validation.Errors
-
getFieldErrorCount
- Specified by:
getFieldErrorCount
in interfaceorg.springframework.validation.Errors
-
getFieldErrors
- Specified by:
getFieldErrors
in interfaceorg.springframework.validation.Errors
-
getFieldError
- Specified by:
getFieldError
in interfaceorg.springframework.validation.Errors
-
getFieldValue
- Specified by:
getFieldValue
in interfaceorg.springframework.validation.Errors
-
getFieldType
- Specified by:
getFieldType
in interfaceorg.springframework.validation.Errors
-