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
,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:
-
Field Summary
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionprotected final String
Fetch a cookie from the HTTP request.protected 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
-
Field Details
-
localeSearchOrder
-
defaultLocale
-
localeCookie
-
localeQueryParam
-
-
Constructor Details
-
GwtServletBase
public GwtServletBase()
-
-
Method Details
-
init
public void init() throws jakarta.servlet.ServletException- Overrides:
init
in classjakarta.servlet.GenericServlet
- Throws:
jakarta.servlet.ServletException
-
getCookie
Fetch a cookie from the HTTP request.- Parameters:
req
-cookieName
-- Returns:
- the value of the cookie or null if not found
-
getGwtLocale
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, IOException - Overrides:
service
in classjakarta.servlet.http.HttpServlet
- Throws:
jakarta.servlet.ServletException
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
-
-