Package com.google.gwt.core.server.jakarta

## Class GwtServletBase

- java.lang.Object
- - jakarta.servlet.GenericServlet
  - - jakarta.servlet.http.HttpServlet
    - - com.google.gwt.core.server.jakarta.GwtServletBase

- All Implemented Interfaces:
    `jakarta.servlet.Servlet`, `jakarta.servlet.ServletConfig`, `java.io.Serializable`

      public class GwtServletBase
      extends jakarta.servlet.http.HttpServlet

  Base servlet for GWT server-side code which extracts properties from the request and sets them for this thread.

  For now, subclasses should override `init()` and set the locale configuration fields - eventually this will be read from a deploy artifact.

  See Also:
    Serialized Form

- - ### Field Summary

    Fields
    Modifier and Type | Field | Description
    --- | --- | ---
    `protected java.lang.String` | `defaultLocale` |
    `protected java.lang.String` | `localeCookie` |
    `protected java.lang.String` | `localeQueryParam` |
    `protected java.lang.String[]` | `localeSearchOrder` |

  - ### Constructor Summary

    Constructors
    Constructor | Description
    --- | ---
    `GwtServletBase()` |

  - ### Method Summary

    All Methods Instance Methods Concrete Methods
    Modifier and Type | Method | Description
    --- | --- | ---
    `protected java.lang.String` | `getCookie​(jakarta.servlet.http.HttpServletRequest req, java.lang.String cookieName)` | Fetch a cookie from the HTTP request.
    `protected java.lang.String` | `getGwtLocale​(jakarta.servlet.http.HttpServletRequest req)` | Get the GWT locale to use from this request.
    `void` | `init()` |
    `protected void` | `service​(jakarta.servlet.http.HttpServletRequest req, jakarta.servlet.http.HttpServletResponse resp)` |
    `protected void` | `setGwtProperties​(jakarta.servlet.http.HttpServletRequest req)` | Sets all GWT properties from the request.

    - ### Methods inherited from class jakarta.servlet.http.HttpServlet

      `doDelete, doGet, doHead, doOptions, doPost, doPut, doTrace, getLastModified, service`

    - ### Methods inherited from class jakarta.servlet.GenericServlet

      `destroy, getInitParameter, getInitParameterNames, getServletConfig, getServletContext, getServletInfo, getServletName, init, log, log`

    - ### Methods inherited from class java.lang.Object

      `clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

- - ### Field Detail

    - #### localeSearchOrder

          protected java.lang.String[] localeSearchOrder

    - #### defaultLocale

          protected java.lang.String defaultLocale

    - #### localeCookie

          protected java.lang.String localeCookie

    - #### localeQueryParam

          protected java.lang.String localeQueryParam

  - ### Constructor Detail

    - #### GwtServletBase

          public GwtServletBase()

  - ### Method Detail

    - #### init

          public void init()
                    throws jakarta.servlet.ServletException

      Overrides:
        `init` in class `jakarta.servlet.GenericServlet`
      Throws:
        `jakarta.servlet.ServletException`

    - #### getCookie

          protected final java.lang.String getCookie​(jakarta.servlet.http.HttpServletRequest req,
                                                     java.lang.String cookieName)

      Fetch a cookie from the HTTP request.
      Parameters:
        `req` -
        `cookieName` -
      Returns:
        the value of the cookie or null if not found

    - #### getGwtLocale

          protected java.lang.String getGwtLocale​(jakarta.servlet.http.HttpServletRequest req)

      Get the GWT locale to use from this request.
      Parameters:
        `req` -
      Returns:
        the GWT locale to use as a String

    - #### service

          protected void service​(jakarta.servlet.http.HttpServletRequest req,
                                 jakarta.servlet.http.HttpServletResponse resp)
                          throws jakarta.servlet.ServletException,
                                 java.io.IOException

      Overrides:
        `service` in class `jakarta.servlet.http.HttpServlet`
      Throws:
        `jakarta.servlet.ServletException`
        `java.io.IOException`

    - #### setGwtProperties

          protected void setGwtProperties​(jakarta.servlet.http.HttpServletRequest req)

      Sets all GWT properties from the request.

      If this method is overridden, this version should be called first and then any modifications to property values should be done.

      Parameters:
        `req` -