类 AbstractMapBasedHandlerMapping<K>

    • 方法详细资料

      • setLazyInitHandlers

        public void setLazyInitHandlers​(boolean lazyInitHandlers)
        Set whether to lazily initialize handlers. Only applicable to singleton handlers, as prototypes are always lazily initialized. Default is false, as eager initialization allows for more efficiency through referencing the handler objects directly.

        If you want to allow your handlers to be lazily initialized, make them "lazy-init" and set this flag to true. Just making them "lazy-init" will not work, as they are initialized through the references from the handler mapping in this case.

      • getLookupKey

        protected abstract K getLookupKey​(PortletRequest request)
                                   throws Exception
        Build a lookup key for the given request.
        参数:
        request - current portlet request
        返回:
        the lookup key (never null)
        抛出:
        Exception - if key computation failed
      • registerHandlers

        protected void registerHandlers​(Map<K,​?> handlerMap)
                                 throws BeansException
        Register all handlers specified in the Portlet mode map for the corresponding modes.
        参数:
        handlerMap - Map with lookup keys as keys and handler beans or bean names as values
        抛出:
        BeansException - if the handler couldn't be registered
      • registerHandler

        protected void registerHandler​(K lookupKey,
                                       Object handler)
                                throws BeansException,
                                       IllegalStateException
        Register the given handler instance for the given parameter value.
        参数:
        lookupKey - the key to map the handler onto
        handler - the handler instance or handler bean name String (a bean name will automatically be resolved into the corresponding handler bean)
        抛出:
        BeansException - if the handler couldn't be registered
        IllegalStateException - if there is a conflicting handler registered