Top Description Inners Fields Constructors Methods
org.eclipse.jetty.ee10.servlet

public Class Invoker

extends HttpServlet
Class Inheritance
Annotations
@SuppressWarnings:serial
Imports
java.io.IOException, java.util.Enumeration, .HashMap, .Locale, .Map, jakarta.servlet.ServletContext, .ServletException, .UnavailableException, jakarta.servlet.http.HttpServlet, .HttpServletRequest, .HttpServletRequestWrapper, .HttpServletResponse, org.eclipse.jetty.server.handler.ContextHandler, org.eclipse.jetty.util.ArrayUtil, .URIUtil, org.eclipse.jetty.util.thread.AutoLock, org.slf4j.Logger, .LoggerFactory

Dynamic Servlet Invoker. This servlet invokes anonymous servlets that have not been defined in the web.xml or by other means. The first element of the pathInfo of a request passed to the invoker is treated as a servlet name for an existing servlet, or as a class name of a new servlet. This servlet is normally mapped to /servlet/* This servlet support the following initParams:
nonContextServlets       If false, the invoker can only load
servlets from the contexts classloader.
This is false by default and setting this
to true may have security implications.

verbose                  If true, log dynamic loads

*                        All other parameters are copied to the
each dynamic servlet as init parameters
Version
$Id: Invoker.java 4780 2009-03-17 15:36:08Z jesse $

Nested and Inner Type Summary

Modifier and TypeClass and Description
pack-priv class

Field Summary

Modifier and TypeField and Description
private ContextHandler
private ServletHandler.MappedServlet
private boolean
private Map<String, String>
private ServletHandler
private boolean
private static final Logger
Inherited from jakarta.servlet.http.HttpServlet:
LEGACY_DO_HEAD

Constructor Summary

AccessConstructor and Description
public

Method Summary

Modifier and TypeMethod and Description
private ServletHolder
getHolder(ServletHolder[] holders, String servlet)

public void
init()

Overrides jakarta.servlet.GenericServlet.init.

A convenience method which can be overridden so that there's no need to call super.init(config).

protected void
service(HttpServletRequest
the HttpServletRequest object that contains the request the client made of the servlet
request
,
HttpServletResponse
the HttpServletResponse object that contains the response the servlet returns to the client
response
)

Overrides jakarta.servlet.http.HttpServlet.service.

Receives standard HTTP requests from the public service method and dispatches them to the doXXX methods defined in this class.

Inherited from jakarta.servlet.http.HttpServlet:
doDeletedoGetdoHeaddoOptionsdoPostdoPutdoTracegetLastModifiedinitservice

Field Detail

_contextHandlerback to summary
private ContextHandler _contextHandler
_invokerEntryback to summary
private ServletHandler.MappedServlet _invokerEntry
_nonContextServletsback to summary
private boolean _nonContextServlets
_parametersback to summary
private Map<String, String> _parameters
_servletHandlerback to summary
private ServletHandler _servletHandler
_verboseback to summary
private boolean _verbose
LOGback to summary
private static final Logger LOG

Constructor Detail

Invokerback to summary
public Invoker()

Method Detail

getHolderback to summary
private ServletHolder getHolder(ServletHolder[] holders, String servlet)
initback to summary
public void init()

Overrides jakarta.servlet.GenericServlet.init.

Doc from jakarta.servlet.GenericServlet.init.

A convenience method which can be overridden so that there's no need to call super.init(config).

Instead of overriding init(ServletConfig), simply override this method and it will be called by GenericServlet.init(ServletConfig config). The ServletConfig object can still be retrieved via getServletConfig.

Annotations
@Override
serviceback to summary
protected void service(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException

Overrides jakarta.servlet.http.HttpServlet.service.

Doc from jakarta.servlet.http.HttpServlet.service.

Receives standard HTTP requests from the public service method and dispatches them to the doXXX methods defined in this class. This method is an HTTP-specific version of the jakarta.servlet.Servlet#service method. There's no need to override this method.

Parameters
request:HttpServletRequest

the HttpServletRequest object that contains the request the client made of the servlet

response:HttpServletResponse

the HttpServletResponse object that contains the response the servlet returns to the client

Annotations
@Override
Exceptions
ServletException:
if the HTTP request cannot be handled
IOException:
if an input or output error occurs while the servlet is handling the HTTP request
org.eclipse.jetty.ee10.servlet back to summary

pack-priv Class Invoker.InvokedRequest

extends HttpServletRequestWrapper
Class Inheritance

Field Summary

Modifier and TypeField and Description
pack-priv boolean
pack-priv String
pack-priv String

Constructor Summary

AccessConstructor and Description
pack-priv
InvokedRequest(HttpServletRequest request, boolean included, String name, String servletPath, String pathInfo)

Method Summary

Modifier and TypeMethod and Description
public Object
getAttribute(String
a String specifying the name of the attribute
name
)

Overrides jakarta.servlet.ServletRequestWrapper.getAttribute.

Implements jakarta.servlet.ServletRequest.getAttribute.

Returns the value of the named attribute as an Object, or null if no attribute of the given name exists.

public String
getPathInfo()

Overrides jakarta.servlet.http.HttpServletRequestWrapper.getPathInfo.

Implements jakarta.servlet.http.HttpServletRequest.getPathInfo.

The default behavior of this method is to return getPathInfo() on the wrapped request object.

public String
getServletPath()

Overrides jakarta.servlet.http.HttpServletRequestWrapper.getServletPath.

Implements jakarta.servlet.http.HttpServletRequest.getServletPath.

The default behavior of this method is to return getServletPath() on the wrapped request object.

Inherited from jakarta.servlet.http.HttpServletRequestWrapper:
authenticatechangeSessionIdgetAuthTypegetContextPathgetCookiesgetDateHeadergetHeadergetHeaderNamesgetHeadersgetHttpServletMappinggetIntHeadergetMethodgetPartgetPartsgetPathTranslatedgetQueryStringgetRemoteUsergetRequestedSessionIdgetRequestURIgetRequestURLgetSessiongetSessiongetTrailerFieldsgetUserPrincipalisRequestedSessionIdFromCookieisRequestedSessionIdFromURLisRequestedSessionIdValidisTrailerFieldsReadyisUserInRoleloginlogoutnewPushBuilderupgrade

Field Detail

_includedback to summary
pack-priv boolean _included
_pathInfoback to summary
pack-priv String _pathInfo
_servletPathback to summary
pack-priv String _servletPath

Constructor Detail

InvokedRequestback to summary
pack-priv InvokedRequest(HttpServletRequest request, boolean included, String name, String servletPath, String pathInfo)

Method Detail

getAttributeback to summary
public Object getAttribute(String name)

Overrides jakarta.servlet.ServletRequestWrapper.getAttribute.

Implements jakarta.servlet.ServletRequest.getAttribute.

Doc from jakarta.servlet.ServletRequest.getAttribute.

Returns the value of the named attribute as an Object, or null if no attribute of the given name exists.

Attributes can be set two ways. The servlet container may set attributes to make available custom information about a request. For example, for requests made using HTTPS, the attribute jakarta.servlet.request.X509Certificate can be used to retrieve information on the certificate of the client. Attributes can also be set programmatically using ServletRequest#setAttribute. This allows information to be embedded into a request before a RequestDispatcher call.

Attribute names should follow the same conventions as package names. This specification reserves names matching java.*, javax.*, and sun.*.

Parameters
name:String

a String specifying the name of the attribute

Returns:Object

an Object containing the value of the attribute, or null if the attribute does not exist

Annotations
@Override
getPathInfoback to summary
public String getPathInfo()

Overrides jakarta.servlet.http.HttpServletRequestWrapper.getPathInfo.

Implements jakarta.servlet.http.HttpServletRequest.getPathInfo.

Doc from jakarta.servlet.http.HttpServletRequestWrapper.getPathInfo.

The default behavior of this method is to return getPathInfo() on the wrapped request object.

Returns:String

Doc from jakarta.servlet.http.HttpServletRequest.getPathInfo.

a String specifying extra path information that comes after the servlet path but before the query string in the request URL; or null if the URL does not have any extra path information. The path will be canonicalized as per section 3.5 of the specification. This method will not return any encoded characters unless the container is configured specifically to allow them.

Annotations
@Override
getServletPathback to summary
public String getServletPath()

Overrides jakarta.servlet.http.HttpServletRequestWrapper.getServletPath.

Implements jakarta.servlet.http.HttpServletRequest.getServletPath.

Doc from jakarta.servlet.http.HttpServletRequestWrapper.getServletPath.

The default behavior of this method is to return getServletPath() on the wrapped request object.

Returns:String

Doc from jakarta.servlet.http.HttpServletRequest.getServletPath.

a String containing the path of the servlet being called, as specified in the request URL, or an empty string if the servlet used to process the request is matched using the "/*" pattern. The path will be canonicalized as per section 3.5 of the specification. This method will not return any encoded characters unless the container is configured specifically to allow them.

Annotations
@Override