Class FilterSpringUtil

java.lang.Object
de.hybris.platform.ycommercewebservices.filter.FilterSpringUtil

public class FilterSpringUtil extends Object
Util class for retrieving spring beans.
  • Method Details

    • getSpringBean

      public static <T> T getSpringBean(javax.servlet.http.HttpServletRequest httpRequest, String beanName, Class<T> beanClass)
      Returns the Spring bean with name beanName and of type beanClass. If no bean could be resolved for the specified name, the bean is looked up using type.
      Type Parameters:
      T - type of the bean
      Parameters:
      httpRequest - the http request
      beanName - name of the bean or null if it should be automatically resolved using type
      beanClass - expected type of the bean
      Returns:
      the bean matching the given arguments or null if no bean could be resolved
    • getSpringBean

      public static <T> T getSpringBean(javax.servlet.ServletContext servletContext, String beanName, Class<T> beanClass)
      The same as getSpringBean(HttpServletRequest, String, Class) but uses ServletContext as the first parameter. It might be used in places, where HttpServletRequest is not available, but ServletContext is.