Class FilterSpringUtil
java.lang.Object
de.hybris.platform.commercewebservices.core.filter.FilterSpringUtil
Util class for retrieving spring beans.
-
Method Summary
Modifier and TypeMethodDescriptionstatic <T> TgetSpringBean(javax.servlet.http.HttpServletRequest httpRequest, String beanName, Class<T> beanClass) Returns the Spring bean with namebeanNameand of typebeanClass.static <T> TgetSpringBean(javax.servlet.ServletContext servletContext, String beanName, Class<T> beanClass) The same asgetSpringBean(HttpServletRequest, String, Class)but uses ServletContext as the first parameter.
-
Method Details
-
getSpringBean
public static <T> T getSpringBean(javax.servlet.http.HttpServletRequest httpRequest, String beanName, Class<T> beanClass) Returns the Spring bean with namebeanNameand of typebeanClass. 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 requestbeanName- name of the bean ornullif it should be automatically resolved using typebeanClass- expected type of the bean- Returns:
- the bean matching the given arguments or
nullif no bean could be resolved
-
getSpringBean
public static <T> T getSpringBean(javax.servlet.ServletContext servletContext, String beanName, Class<T> beanClass) The same asgetSpringBean(HttpServletRequest, String, Class)but uses ServletContext as the first parameter. It might be used in places, where HttpServletRequest is not available, but ServletContext is.
-