Undertow Documentation

repository·main·Indexed 26 days ago

https://github.com/undertow-io/undertow

A high-performance, non-blocking Java web server providing a core HTTP server, Servlet implementation (supporting versions 4.0, 5.0, and 6.0), and JSR-356/Jakarta 2.0 compliant WebSockets.

Tokens
607
Snippets
1
Records
7
Agent score
87%

What's inside Undertow

  1. Overview of Undertow capabilities

    main

    Undertow is a high-performance Java web server built on non-blocking IO. It provides three primary components:

    • Core HTTP Server: Supports both blocking and non-blocking IO.
    • Servlet Implementation: Supports Servlet 4.0, 5.0, and 6.0 specifications.
    • WebSocket Implementation: JSR-356/Jakarta 2.0 compliant.

    For more information, visit the official website at http://undertow.io.

  2. Run Undertow examples

    main
    You can run the provided Undertow examples to see how to run an embedded Undertow server. You can execute them using either the compiled JAR file or via Maven. Once started, a menu will appear allowing you to select the specific example you wish to run.
  3. Manage authenticated user sessions with AuthenticatedSessionManager

    main

    The AuthenticatedSessionManager interface is used to manage persistent authenticated user sessions within an Undertow HttpServerExchange.

    To access the manager associated with a specific exchange, use the ATTACHMENT_KEY constant. This allows you to retrieve or attach a manager to the exchange's attachments.

    Key methods:

    • lookupSession(HttpServerExchange exchange): Retrieves the current AuthenticatedSession associated with the provided exchange.
    • clearSession(HttpServerExchange exchange): Clears/invalidates the authenticated session for the provided exchange.
  4. Use AuthenticatedSession to access account and mechanism details

    main

    The AuthenticatedSession class represents a persistent authenticated session. It contains the user's Account and the authentication mechanism used to establish the session.

    Methods:

    • getAccount(): Returns the Account associated with the session.
    • getMechanism(): Returns the String representing the authentication mechanism.