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

public Class ServletHolder

extends Holder<Servlet>
implements Comparable<ServletHolder>
Class Inheritance
All Implemented Interfaces
java.lang.Comparable
Annotations
@ManagedObject:Servlet Holder
Imports
java.io.File, .IOException, java.lang.reflect.InvocationTargetException, .Method, java.util.ArrayList, .Arrays, .Collection, .Collections, .HashMap, .HashSet, .List, .Map, .Objects, .Set, .Stack, java.util.concurrent.atomic.AtomicLong, jakarta.servlet.GenericServlet, .MultipartConfigElement, .Servlet, .ServletConfig, .ServletContext, .ServletException, .ServletRegistration, .ServletRequest, .ServletResponse, .ServletSecurityElement, .UnavailableException, jakarta.servlet.http.HttpServletResponse, org.eclipse.jetty.security.AuthenticationState, .IdentityService, .UserIdentity, org.eclipse.jetty.server.handler.ContextHandler, org.eclipse.jetty.util.Loader, .NanoTime, .StringUtil, org.eclipse.jetty.util.annotation.ManagedAttribute, .ManagedObject, org.eclipse.jetty.util.component.Dumpable, .DumpableCollection, org.eclipse.jetty.util.thread.AutoLock, org.slf4j.Logger, .LoggerFactory

Servlet Instance and Context Holder.

Holds the name, params and some state of a jakarta.servlet.Servlet instance. It implements the ServletConfig interface. This class will organise the loading of the servlet when needed or requested.

Nested and Inner Type Summary

Modifier and TypeClass and Description
protected class
public static enum
private static class
public class
private static class
private class
private class
public static interface
ServletHolder.WrapFunction

Experimental Wrapper mechanism for Servlet objects.

public static class

Field Summary

Modifier and TypeField and Description
private ServletHolder.Config
private boolean
private String
private boolean
private int
private ServletHolder.JspContainer
private ServletHolder.Registration
private Map<String, String>
private String
private volatile Servlet
public static final String
public static final String
private static final Logger

Constructor Summary

AccessConstructor and Description
public
ServletHolder()

Constructor .

public
ServletHolder(Source
the holder source
creator
)

Constructor .

public
ServletHolder(Servlet
the servlet
servlet
)

Constructor for existing servlet.

public
ServletHolder(String
the name of the servlet
name
,
Class<? extends Servlet>
the servlet class
servlet
)

Constructor for servlet class.

public
ServletHolder(String
the servlet name
name
,
Servlet
the servlet
servlet
)

Constructor for servlet class.

public
ServletHolder(Class<? extends Servlet>
the servlet class
servlet
)

Constructor for servlet class.

Method Summary

Modifier and TypeMethod and Description
protected void
appendPath(StringBuffer
the path under construction
path
,
String
the element of the name to add
element
)

Concatenate an element on to fully qualified classname.

private void
checkInitOnStartup()

Check if there is a jakarta.servlet.annotation.ServletSecurity annotation on the servlet class.

public void
checkServletType()

Check to ensure class of servlet is acceptable.

public int
compareTo(ServletHolder
the object to be compared.
sh
)

Implements java.lang.Comparable.compareTo.

Comparator by init order.

protected Servlet
public void
private void
public void
doStart()

Overrides org.eclipse.jetty.ee10.servlet.BaseHolder.doStart.

Method to override to start the lifecycle

public void
doStop()

Overrides org.eclipse.jetty.ee10.servlet.BaseHolder.doStop.

Method to override to stop the lifecycle

public void
dump(Appendable
The appendable to dump to
out
,
String
The indent to apply after any new lines.
indent
)

Overrides org.eclipse.jetty.ee10.servlet.BaseHolder.dump.

Implements org.eclipse.jetty.util.component.Dumpable.dump.

Dump this object (and children) into an Appendable using the provided indent after any new lines.

public boolean
equals(Object
the reference object with which to compare.
o
)

Overrides java.lang.Object.equals.

Indicates whether some other object is "equal to" this one.

public String
getClassNameForJsp(String
the jsp-file from web.xml
jsp
)

Returns: the fully qualified classname

public String
getForcedPath()

Returns: Returns the forcedPath.

public int
public String

Returns:

the package for all jsps
getJspPackagePrefix
()

Get the package for all jsps.

public MultipartConfigElement
public String
getNameOfJspClass(String
the jsp-file
jsp
)

Returns: the simple classname of the jsp

public String
public ServletHolder.Registration
public String
public Servlet

Returns:

The servlet
getServlet
()

Get the servlet.

public Servlet

Returns:

The servlet or null
getServletInstance
()

Get the servlet instance (no initialization done).

public UnavailableException
getUnavailableException()

Returns: The unavailable exception or null if not unavailable

public void
handle(ServletRequest
the request
request
,
ServletResponse
the response
response
)

Service a request with this servlet.

public int
hashCode()

Overrides java.lang.Object.hashCode.

Returns a hash code value for this object.

public void
initialize()

Overrides org.eclipse.jetty.ee10.servlet.BaseHolder.initialize.

Do any setup necessary after starting

protected void
private void
public boolean
isAvailable()

Returns: true if the holder is started and is not unavailable

public boolean
protected boolean
protected boolean
isJspServlet(String classname)

private Servlet
private void
protected Servlet
newInstance()

Returns: the newly created Servlet instance

private void
protected void
prepare(ServletRequest
the request
request
,
ServletResponse
the response
response
)

Prepare to service a request.

private void
public void
setEnabled(boolean enabled)

public void
setForcedPath(String
The forcedPath to set.
forcedPath
)

public void
setInitOrder(int
the servlet init order
order
)

Set the initialize order.

public void
public void
public String
toString()

Overrides org.eclipse.jetty.ee10.servlet.Holder.toString.

Returns a string representation of the object.

Inherited from org.eclipse.jetty.ee10.servlet.Holder:
dumpgetDisplayNamegetInitParametergetInitParameterNamesgetInitParametersgetNameisAsyncSupportedsetAsyncSupportedsetClassNamesetDisplayNamesetHeldClasssetInitParametersetInitParameterssetInstancesetName