类 PortletContentGenerator

    • 方法详细资料

      • setRequireSession

        public final void setRequireSession​(boolean requireSession)
        Set whether a session should be required to handle requests.
      • isRequireSession

        public final boolean isRequireSession()
        Return whether a session is required to handle requests.
      • setCacheSeconds

        public final void setCacheSeconds​(int seconds)
        Cache content for the given number of seconds. Default is -1, indicating no override of portlet content caching.

        Only if this is set to 0 (no cache) or a positive value (cache for this many seconds) will this class override the portlet settings.

        The cache setting can be overwritten by subclasses, before content is generated.

      • getCacheSeconds

        public final int getCacheSeconds()
        Return the number of seconds that content is cached.
      • check

        protected final void check​(PortletRequest request,
                                   PortletResponse response)
                            throws PortletException
        Check and prepare the given request and response according to the settings of this generator. Checks for a required session, and applies the number of cache seconds configured for this generator (if it is a render request/response).
        参数:
        request - current portlet request
        response - current portlet response
        抛出:
        PortletException - if the request cannot be handled because a check failed
      • checkAndPrepare

        protected final void checkAndPrepare​(PortletRequest request,
                                             MimeResponse response)
                                      throws PortletException
        Check and prepare the given request and response according to the settings of this generator. Checks for a required session, and applies the number of cache seconds configured for this generator (if it is a render request/response).
        参数:
        request - current portlet request
        response - current portlet response
        抛出:
        PortletException - if the request cannot be handled because a check failed
      • checkAndPrepare

        protected final void checkAndPrepare​(PortletRequest request,
                                             MimeResponse response,
                                             int cacheSeconds)
                                      throws PortletException
        Check and prepare the given request and response according to the settings of this generator. Checks for a required session, and applies the given number of cache seconds (if it is a render request/response).
        参数:
        request - current portlet request
        response - current portlet response
        cacheSeconds - positive number of seconds into the future that the response should be cacheable for, 0 to prevent caching
        抛出:
        PortletException - if the request cannot be handled because a check failed
      • cacheForSeconds

        protected final void cacheForSeconds​(MimeResponse response,
                                             int seconds)
        Set portlet response to allow caching for the given number of seconds.
        参数:
        response - current portlet render response
        seconds - number of seconds into the future that the response should be cacheable for
      • applyCacheSeconds

        protected final void applyCacheSeconds​(MimeResponse response,
                                               int seconds)
        Apply the given cache seconds to the render response
        参数:
        response - current portlet render response
        seconds - positive number of seconds into the future that the response should be cacheable for, 0 to prevent caching