Class BaseController

    • Field Summary

      Fields 
      Modifier and Type Field Description
      protected static java.lang.String MODEL_ERROR_ATTR  
    • Constructor Summary

      Constructors 
      Constructor Description
      BaseController()  
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      protected java.util.Map<java.lang.String,​java.lang.String> getErrorsFromDataIntegrityViolationException​(org.springframework.dao.DataIntegrityViolationException e, java.util.Map<java.lang.String,​ExceptionPropertyAndMessage> messageNames, org.springframework.context.MessageSource messageSource, java.util.Locale locale)
      Converts a DataIntegrityViolationException to a usable map of strings for displaying in the UI.
      protected java.util.Map<java.lang.String,​java.lang.String> getErrorsFromViolationException​(javax.validation.ConstraintViolationException e)
      Changes a ConstraintViolationException to a usable map of strings for displaying in the UI.
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Field Detail

      • MODEL_ERROR_ATTR

        protected static final java.lang.String MODEL_ERROR_ATTR
        See Also:
        Constant Field Values
    • Constructor Detail

      • BaseController

        public BaseController()
    • Method Detail

      • getErrorsFromViolationException

        protected java.util.Map<java.lang.String,​java.lang.String> getErrorsFromViolationException​(javax.validation.ConstraintViolationException e)
        Changes a ConstraintViolationException to a usable map of strings for displaying in the UI.
        Parameters:
        e - ConstraintViolationException for the form submitted.
        Returns:
        Map of string {fieldName, error}
      • getErrorsFromDataIntegrityViolationException

        protected java.util.Map<java.lang.String,​java.lang.String> getErrorsFromDataIntegrityViolationException​(org.springframework.dao.DataIntegrityViolationException e,
                                                                                                                      java.util.Map<java.lang.String,​ExceptionPropertyAndMessage> messageNames,
                                                                                                                      org.springframework.context.MessageSource messageSource,
                                                                                                                      java.util.Locale locale)
        Converts a DataIntegrityViolationException to a usable map of strings for displaying in the UI.
        Parameters:
        e - The exception for the form submitted
        messageNames - A map of the error message names
        messageSource - A message source to get the messages from
        locale - The locale of the request
        Returns:
        A Map of strings with the property names and error messages