You're viewing an older version of Vaadin JavaDoc. Please see version 24.7.0 for the latest.
com.vaadin.flow.server.

Interface StaticFileHandler

  • All Superinterfaces:

    Serializable

    All Known Implementing Classes:

    StaticFileServer

    public interface StaticFileHandler
    extends Serializable

    Handler for static files. The handler should be responsible in identifying and serving the static files, based on the servlet request.

    Since:

    1.3

    Author:

    Vaadin Ltd.

    See Also:

    StaticFileServer

    • Method Summary

      All Methods
      Modifier and Type Method Description
      boolean serveStaticResource​(javax.servlet.http.HttpServletRequest request, javax.servlet.http.HttpServletResponse response)

      Serves a static resource for the requested path if a resource can be found.

    • Method Detail

      • serveStaticResource

        boolean serveStaticResource​(javax.servlet.http.HttpServletRequest request,
                                    javax.servlet.http.HttpServletResponse response)
                             throws IOException

        Serves a static resource for the requested path if a resource can be found.

        Parameters:

        request - the request object to read from

        response - the response object to write to

        Returns:

        true if a file was served and the request has been handled, false otherwise.

        Throws:

        IOException - if the underlying servlet container reports an exception