Class AbstractController

    • Field Summary

      Fields 
      Modifier and Type Field Description
      static java.lang.String FORWARD_PREFIX  
      static java.lang.String REDIRECT_PREFIX  
      static java.lang.String ROOT  
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      javax.servlet.http.HttpServletRequest addRequestToModel​(javax.servlet.http.HttpServletRequest request)  
      protected <T> T getBean​(javax.servlet.http.HttpServletRequest request, java.lang.String beanName, java.lang.Class<T> beanType)
      Helper method to lookup a spring bean in the context of a request.
      • Methods inherited from class java.lang.Object

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

      • AbstractController

        public AbstractController()
    • Method Detail

      • addRequestToModel

        @ModelAttribute("request")
        public javax.servlet.http.HttpServletRequest addRequestToModel​(javax.servlet.http.HttpServletRequest request)
      • getBean

        protected <T> T getBean​(javax.servlet.http.HttpServletRequest request,
                                java.lang.String beanName,
                                java.lang.Class<T> beanType)
        Helper method to lookup a spring bean in the context of a request. This should only be used to lookup beans that are request scoped. The looked up bean is cached in the request attributes so it should not have a narrower scope than request scope. This method should not be used for beans that could be injected into this bean.
        Type Parameters:
        T - the expected type of the bean
        Parameters:
        request - the current request
        beanName - the name of the bean to lookup
        beanType - the expected type of the bean
        Returns:
        the bean found or null