com.vaadin.flow.server.

Class VaadinServletResponse

  • java.lang.Object
    • HttpServletResponseWrapper
      • com.vaadin.flow.server.VaadinServletResponse
    • Constructor Detail

      • VaadinServletResponse

        public VaadinServletResponse(HttpServletResponse response,
                                     VaadinServletService vaadinService)

        Wraps a http servlet response and an associated vaadin service.

        Parameters:

        response - the http servlet response to wrap

        vaadinService - the associated vaadin service

    • Method Detail

      • getHttpServletResponse

        public HttpServletResponse getHttpServletResponse()

        Gets the original unwrapped HttpServletResponse.

        Returns:

        the unwrapped response

      • setCacheTime

        public void setCacheTime(long milliseconds)

        Description copied from interface: VaadinResponse

        Sets cache time in milliseconds, -1 means no cache at all. All required headers related to caching in the response are set based on the time.

        Specified by:

        setCacheTime in interface VaadinResponse

        Parameters:

        milliseconds - Cache time in milliseconds

      • getCurrent

        public static VaadinServletResponse getCurrent()

        Gets the currently processed Vaadin servlet response. The current response is automatically defined when the request is started. The current response can not be used in e.g. background threads because of the way server implementations reuse response instances.

        Specified by:

        getCurrent in interface VaadinResponse

        Returns:

        the current Vaadin servlet response instance if available, otherwise null