Interface DevModeHandler

All Superinterfaces:
RequestHandler, Serializable
All Known Implementing Classes:
AbstractDevServerRunner, DevBundleBuildingHandler, ViteHandler

public interface DevModeHandler extends RequestHandler
Request handler for development mode, providing proxy capabilities to the development server and access to compilation output.

For internal use only. May be renamed or removed in a future release.

  • Method Summary

    Modifier and Type
    Method
    Description
    Return the dev server console output when a compilation error happened.
    int
    Get the listening port of the dev server.
    Gets the project root folder.
    Prepare a HTTP connection against the dev server.
    boolean
    serveDevModeRequest(jakarta.servlet.http.HttpServletRequest request, jakarta.servlet.http.HttpServletResponse response)
    Serve a file by proxying to the dev server.
    void
    Stop the dev-server.

    Methods inherited from interface com.vaadin.flow.server.RequestHandler

    handleRequest
  • Method Details

    • getFailedOutput

      String getFailedOutput()
      Return the dev server console output when a compilation error happened.
      Returns:
      console output if error or null otherwise.
    • prepareConnection

      HttpURLConnection prepareConnection(String path, String method) throws IOException
      Prepare a HTTP connection against the dev server.
      Parameters:
      path - the file to request, needs to be safe
      method - the http method to use
      Returns:
      the connection
      Throws:
      IOException - on connection error
    • serveDevModeRequest

      boolean serveDevModeRequest(jakarta.servlet.http.HttpServletRequest request, jakarta.servlet.http.HttpServletResponse response) throws IOException
      Serve a file by proxying to the dev server.
      Parameters:
      request - the servlet request
      response - the servlet response
      Returns:
      false if the dev server returned a not found, true otherwise
      Throws:
      IOException - in the case something went wrong like connection refused
    • stop

      void stop()
      Stop the dev-server.
    • getProjectRoot

      File getProjectRoot()
      Gets the project root folder.
      Returns:
      the project root folder
    • getPort

      int getPort()
      Get the listening port of the dev server.
      Returns:
      the listening port