Class SpringHelper


  • public final class SpringHelper
    extends java.lang.Object
    Static class used to lookup a spring bean by name and type.
    • Method Summary

      All Methods Static Methods Concrete Methods 
      Modifier and Type Method Description
      static <T> T getSpringBean​(javax.servlet.ServletRequest request, java.lang.String beanName, java.lang.Class<T> beanClass, boolean cacheInRequest)
      Returns the Spring bean with name beanName and of type beanClass.
      protected static void logDebugInfo​(java.lang.Exception ex, java.lang.String message)  
      • Methods inherited from class java.lang.Object

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

      • getSpringBean

        public static <T> T getSpringBean​(javax.servlet.ServletRequest request,
                                          java.lang.String beanName,
                                          java.lang.Class<T> beanClass,
                                          boolean cacheInRequest)
        Returns the Spring bean with name beanName and of type beanClass. If the cacheInRequest flag is set to true then the bean is cached in the request attributes.
        Type Parameters:
        T - type of the bean
        Parameters:
        request - the http request
        beanName - name of the bean
        beanClass - expected type of the bean
        cacheInRequest - flag, set to true to use the request attributes to cache the spring bean
        Returns:
        the bean matching the given arguments or null if no bean could be resolved
      • logDebugInfo

        protected static void logDebugInfo​(java.lang.Exception ex,
                                           java.lang.String message)