blob: f9d184efd620a9aff6b2ca6726f375fe8a020822 [file] [log] [blame]
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<!-- NewPage -->
<html lang="en">
<head>
<!-- Generated by javadoc -->
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>RestServlet (Apache Juneau 9.0.0)</title>
<link rel="stylesheet" type="text/css" href="../../../../../javadoc.css" title="Style">
<script type="text/javascript" src="../../../../../script.js"></script>
</head>
<body>
<script type="text/javascript"><!--
try {
if (location.href.indexOf('is-external=true') == -1) {
parent.document.title="RestServlet (Apache Juneau 9.0.0)";
}
}
catch(err) {
}
//-->
var methods = {"i0":10,"i1":10,"i2":10,"i3":10,"i4":10,"i5":10,"i6":10,"i7":10,"i8":10,"i9":10,"i10":10};
var tabs = {65535:["t0","All Methods"],2:["t2","Instance Methods"],8:["t4","Concrete Methods"]};
var altColor = "altColor";
var rowColor = "rowColor";
var tableTab = "tableTab";
var activeTableTab = "activeTableTab";
</script>
<noscript>
<div>JavaScript is disabled on your browser.</div>
</noscript>
<!-- ========= START OF TOP NAVBAR ======= -->
<div class="topNav"><a name="navbar.top">
<!-- -->
</a>
<div class="skipNav"><a href="#skip.navbar.top" title="Skip navigation links">Skip navigation links</a></div>
<a name="navbar.top.firstrow">
<!-- -->
</a>
<ul class="navList" title="Navigation">
<li><a href="../../../../../overview-summary.html">Overview</a></li>
<li><a href="package-summary.html">Package</a></li>
<li class="navBarCell1Rev">Class</li>
<li><a href="package-tree.html">Tree</a></li>
<li><a href="../../../../../deprecated-list.html">Deprecated</a></li>
<li><a href="../../../../../index-all.html">Index</a></li>
<li><a href="../../../../../help-doc.html">Help</a></li>
</ul>
</div>
<div class="subNav">
<ul class="navList">
<li><a href="../../../../../org/apache/juneau/rest/servlet/RestObject.html" title="class in org.apache.juneau.rest.servlet"><span class="typeNameLink">Prev&nbsp;Class</span></a></li>
<li>Next&nbsp;Class</li>
</ul>
<ul class="navList">
<li><a href="../../../../../index.html?org/apache/juneau/rest/servlet/RestServlet.html" target="_top">Frames</a></li>
<li><a href="RestServlet.html" target="_top">No&nbsp;Frames</a></li>
</ul>
<ul class="navList" id="allclasses_navbar_top">
<li><a href="../../../../../allclasses-noframe.html">All&nbsp;Classes</a></li>
</ul>
<div>
<script type="text/javascript"><!--
allClassesLink = document.getElementById("allclasses_navbar_top");
if(window==top) {
allClassesLink.style.display = "block";
}
else {
allClassesLink.style.display = "none";
}
//-->
</script>
</div>
<div>
<ul class="subNavList">
<li>Summary:&nbsp;</li>
<li>Nested&nbsp;|&nbsp;</li>
<li>Field&nbsp;|&nbsp;</li>
<li><a href="#constructor.summary">Constr</a>&nbsp;|&nbsp;</li>
<li><a href="#method.summary">Method</a></li>
</ul>
<ul class="subNavList">
<li>Detail:&nbsp;</li>
<li>Field&nbsp;|&nbsp;</li>
<li><a href="#constructor.detail">Constr</a>&nbsp;|&nbsp;</li>
<li><a href="#method.detail">Method</a></li>
</ul>
</div>
<a name="skip.navbar.top">
<!-- -->
</a></div>
<!-- ========= END OF TOP NAVBAR ========= -->
<!-- ======== START OF CLASS DATA ======== -->
<div class="header">
<div class="subTitle">org.apache.juneau.rest.servlet</div>
<h2 title="Class RestServlet" class="title">Class RestServlet</h2>
</div>
<div class="contentContainer">
<ul class="inheritance">
<li><a href="https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html?is-external=true" title="class or interface in java.lang">java.lang.Object</a></li>
<li>
<ul class="inheritance">
<li>javax.servlet.GenericServlet</li>
<li>
<ul class="inheritance">
<li>javax.servlet.http.HttpServlet</li>
<li>
<ul class="inheritance">
<li>org.apache.juneau.rest.servlet.RestServlet</li>
</ul>
</li>
</ul>
</li>
</ul>
</li>
</ul>
<div class="description">
<ul class="blockList">
<li class="blockList">
<dl>
<dt>All Implemented Interfaces:</dt>
<dd><a href="https://docs.oracle.com/javase/8/docs/api/java/io/Serializable.html?is-external=true" title="class or interface in java.io">Serializable</a>, javax.servlet.Servlet, javax.servlet.ServletConfig</dd>
</dl>
<dl>
<dt>Direct Known Subclasses:</dt>
<dd><a href="../../../../../org/apache/juneau/rest/servlet/BasicRestServlet.html" title="class in org.apache.juneau.rest.servlet">BasicRestServlet</a>, <a href="../../../../../org/apache/juneau/server/config/rest/LoadConfigResource.html" title="class in org.apache.juneau.server.config.rest">LoadConfigResource</a>, <a href="../../../../../org/apache/juneau/rest/springboot/SpringRestServlet.html" title="class in org.apache.juneau.rest.springboot">SpringRestServlet</a></dd>
</dl>
<hr>
<br>
<pre>public abstract class <a href="../../../../../src-html/org/apache/juneau/rest/servlet/RestServlet.html#line.62">RestServlet</a>
extends javax.servlet.http.HttpServlet</pre>
<div class="block">Servlet implementation of a REST resource.
<p>
The <a href="../../../../../org/apache/juneau/rest/servlet/RestServlet.html" title="class in org.apache.juneau.rest.servlet"><code>RestServlet</code></a> class is the entry point for your REST resources.
It extends directly from <l>HttpServlet</l> and is deployed like any other servlet.
</p>
<p>
When the servlet <l>init()</l> method is called, it triggers the code to find and process the <l>@Rest</l>
annotations on that class and all child classes.
These get constructed into a <a href="../../../../../org/apache/juneau/rest/RestContext.html" title="class in org.apache.juneau.rest"><code>RestContext</code></a> object that holds all the configuration
information about your resource in a read-only object.
</p>
<ul class='notes'>
<li class='note'>
Users will typically extend from <a href="../../../../../org/apache/juneau/rest/servlet/BasicRestServlet.html" title="class in org.apache.juneau.rest.servlet"><code>BasicRestServlet</code></a> or <a href="../../../../../org/apache/juneau/rest/servlet/BasicRestServletGroup.html" title="class in org.apache.juneau.rest.servlet"><code>BasicRestServletGroup</code></a>
instead of this class directly.
</ul>
<ul class='seealso'>
<li class='link'><a class='doclink' href='../../../../../overview-summary.html#juneau-rest-server.jrs.AnnotatedClasses'>Overview &gt; juneau-rest-server &gt; @Rest-Annotated Classes</a>
<li class='extlink'><a class='doclink' target='_blank' href='https://github.com/apache/juneau/blob/master/juneau-rest/juneau-rest-server/src/main/java/org/apache/juneau/rest/servlet/RestServlet.java'>Source</a>
</ul></div>
</li>
</ul>
</div>
<div class="summary">
<ul class="blockList">
<li class="blockList">
<!-- ======== CONSTRUCTOR SUMMARY ======== -->
<ul class="blockList">
<li class="blockList"><a name="constructor.summary">
<!-- -->
</a>
<h3>Constructor Summary</h3>
<table class="memberSummary" border="0" cellpadding="3" cellspacing="0" summary="Constructor Summary table, listing constructors, and an explanation">
<caption><span>Constructors</span><span class="tabEnd">&nbsp;</span></caption>
<tr>
<th class="colOne" scope="col">Constructor and Description</th>
</tr>
<tr class="altColor">
<td class="colOne"><code><span class="memberNameLink"><a href="../../../../../org/apache/juneau/rest/servlet/RestServlet.html#RestServlet--">RestServlet</a></span>()</code>&nbsp;</td>
</tr>
</table>
</li>
</ul>
<!-- ========== METHOD SUMMARY =========== -->
<ul class="blockList">
<li class="blockList"><a name="method.summary">
<!-- -->
</a>
<h3>Method Summary</h3>
<table class="memberSummary" border="0" cellpadding="3" cellspacing="0" summary="Method Summary table, listing methods, and an explanation">
<caption><span id="t0" class="activeTableTab"><span>All Methods</span><span class="tabEnd">&nbsp;</span></span><span id="t2" class="tableTab"><span><a href="javascript:show(2);">Instance Methods</a></span><span class="tabEnd">&nbsp;</span></span><span id="t4" class="tableTab"><span><a href="javascript:show(8);">Concrete Methods</a></span><span class="tabEnd">&nbsp;</span></span></caption>
<tr>
<th class="colFirst" scope="col">Modifier and Type</th>
<th class="colLast" scope="col">Method and Description</th>
</tr>
<tr id="i0" class="altColor">
<td class="colFirst"><code>void</code></td>
<td class="colLast"><code><span class="memberNameLink"><a href="../../../../../org/apache/juneau/rest/servlet/RestServlet.html#destroy--">destroy</a></span>()</code>&nbsp;</td>
</tr>
<tr id="i1" class="rowColor">
<td class="colFirst"><code>protected void</code></td>
<td class="colLast"><code><span class="memberNameLink"><a href="../../../../../org/apache/juneau/rest/servlet/RestServlet.html#doLog-java.util.logging.Level-java.lang.Throwable-java.util.function.Supplier-">doLog</a></span>(<a href="https://docs.oracle.com/javase/8/docs/api/java/util/logging/Level.html?is-external=true" title="class or interface in java.util.logging">Level</a>&nbsp;level,
<a href="https://docs.oracle.com/javase/8/docs/api/java/lang/Throwable.html?is-external=true" title="class or interface in java.lang">Throwable</a>&nbsp;cause,
<a href="https://docs.oracle.com/javase/8/docs/api/java/util/function/Supplier.html?is-external=true" title="class or interface in java.util.function">Supplier</a>&lt;<a href="https://docs.oracle.com/javase/8/docs/api/java/lang/String.html?is-external=true" title="class or interface in java.lang">String</a>&gt;&nbsp;msg)</code>
<div class="block">Main logger method.</div>
</td>
</tr>
<tr id="i2" class="altColor">
<td class="colFirst"><code><a href="../../../../../org/apache/juneau/rest/RestContext.html" title="class in org.apache.juneau.rest">RestContext</a></code></td>
<td class="colLast"><code><span class="memberNameLink"><a href="../../../../../org/apache/juneau/rest/servlet/RestServlet.html#getContext--">getContext</a></span>()</code>
<div class="block">Returns the read-only context object that contains all the configuration information about this resource.</div>
</td>
</tr>
<tr id="i3" class="rowColor">
<td class="colFirst"><code><a href="https://docs.oracle.com/javase/8/docs/api/java/lang/String.html?is-external=true" title="class or interface in java.lang">String</a></code></td>
<td class="colLast"><code><span class="memberNameLink"><a href="../../../../../org/apache/juneau/rest/servlet/RestServlet.html#getPath--">getPath</a></span>()</code>
<div class="block">Returns the path for this resource as defined by the @Rest(path) annotation or RestContext.Builder.path(String) method
concatenated with those on all parent classes.</div>
</td>
</tr>
<tr id="i4" class="altColor">
<td class="colFirst"><code><a href="../../../../../org/apache/juneau/rest/RestRequest.html" title="class in org.apache.juneau.rest">RestRequest</a></code></td>
<td class="colLast"><code><span class="memberNameLink"><a href="../../../../../org/apache/juneau/rest/servlet/RestServlet.html#getRequest--">getRequest</a></span>()</code>
<div class="block">Returns the current thread-local HTTP request.</div>
</td>
</tr>
<tr id="i5" class="rowColor">
<td class="colFirst"><code><a href="../../../../../org/apache/juneau/rest/RestResponse.html" title="class in org.apache.juneau.rest">RestResponse</a></code></td>
<td class="colLast"><code><span class="memberNameLink"><a href="../../../../../org/apache/juneau/rest/servlet/RestServlet.html#getResponse--">getResponse</a></span>()</code>
<div class="block">Returns the current thread-local HTTP response.</div>
</td>
</tr>
<tr id="i6" class="altColor">
<td class="colFirst"><code>void</code></td>
<td class="colLast"><code><span class="memberNameLink"><a href="../../../../../org/apache/juneau/rest/servlet/RestServlet.html#init-javax.servlet.ServletConfig-">init</a></span>(javax.servlet.ServletConfig&nbsp;servletConfig)</code>&nbsp;</td>
</tr>
<tr id="i7" class="rowColor">
<td class="colFirst"><code>void</code></td>
<td class="colLast"><code><span class="memberNameLink"><a href="../../../../../org/apache/juneau/rest/servlet/RestServlet.html#log-java.util.logging.Level-java.lang.String-java.lang.Object...-">log</a></span>(<a href="https://docs.oracle.com/javase/8/docs/api/java/util/logging/Level.html?is-external=true" title="class or interface in java.util.logging">Level</a>&nbsp;level,
<a href="https://docs.oracle.com/javase/8/docs/api/java/lang/String.html?is-external=true" title="class or interface in java.lang">String</a>&nbsp;msg,
<a href="https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html?is-external=true" title="class or interface in java.lang">Object</a>...&nbsp;args)</code>
<div class="block">Log a message.</div>
</td>
</tr>
<tr id="i8" class="altColor">
<td class="colFirst"><code>void</code></td>
<td class="colLast"><code><span class="memberNameLink"><a href="../../../../../org/apache/juneau/rest/servlet/RestServlet.html#log-java.util.logging.Level-java.lang.Throwable-java.lang.String-java.lang.Object...-">log</a></span>(<a href="https://docs.oracle.com/javase/8/docs/api/java/util/logging/Level.html?is-external=true" title="class or interface in java.util.logging">Level</a>&nbsp;level,
<a href="https://docs.oracle.com/javase/8/docs/api/java/lang/Throwable.html?is-external=true" title="class or interface in java.lang">Throwable</a>&nbsp;cause,
<a href="https://docs.oracle.com/javase/8/docs/api/java/lang/String.html?is-external=true" title="class or interface in java.lang">String</a>&nbsp;msg,
<a href="https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html?is-external=true" title="class or interface in java.lang">Object</a>...&nbsp;args)</code>
<div class="block">Log a message.</div>
</td>
</tr>
<tr id="i9" class="rowColor">
<td class="colFirst"><code>void</code></td>
<td class="colLast"><code><span class="memberNameLink"><a href="../../../../../org/apache/juneau/rest/servlet/RestServlet.html#service-javax.servlet.http.HttpServletRequest-javax.servlet.http.HttpServletResponse-">service</a></span>(javax.servlet.http.HttpServletRequest&nbsp;r1,
javax.servlet.http.HttpServletResponse&nbsp;r2)</code>
<div class="block">The main service method.</div>
</td>
</tr>
<tr id="i10" class="altColor">
<td class="colFirst"><code>protected void</code></td>
<td class="colLast"><code><span class="memberNameLink"><a href="../../../../../org/apache/juneau/rest/servlet/RestServlet.html#setContext-org.apache.juneau.rest.RestContext-">setContext</a></span>(<a href="../../../../../org/apache/juneau/rest/RestContext.html" title="class in org.apache.juneau.rest">RestContext</a>&nbsp;context)</code>
<div class="block">Sets the context object for this servlet.</div>
</td>
</tr>
</table>
<ul class="blockList">
<li class="blockList"><a name="methods.inherited.from.class.javax.servlet.http.HttpServlet">
<!-- -->
</a>
<h3>Methods inherited from class&nbsp;javax.servlet.http.HttpServlet</h3>
<code>doDelete, doGet, doHead, doOptions, doPost, doPut, doTrace, getLastModified, service</code></li>
</ul>
<ul class="blockList">
<li class="blockList"><a name="methods.inherited.from.class.javax.servlet.GenericServlet">
<!-- -->
</a>
<h3>Methods inherited from class&nbsp;javax.servlet.GenericServlet</h3>
<code>getInitParameter, getInitParameterNames, getServletConfig, getServletContext, getServletInfo, getServletName, init, log, log</code></li>
</ul>
<ul class="blockList">
<li class="blockList"><a name="methods.inherited.from.class.java.lang.Object">
<!-- -->
</a>
<h3>Methods inherited from class&nbsp;java.lang.<a href="https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html?is-external=true" title="class or interface in java.lang">Object</a></h3>
<code><a href="https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html?is-external=true#clone--" title="class or interface in java.lang">clone</a>, <a href="https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html?is-external=true#equals-java.lang.Object-" title="class or interface in java.lang">equals</a>, <a href="https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html?is-external=true#finalize--" title="class or interface in java.lang">finalize</a>, <a href="https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html?is-external=true#getClass--" title="class or interface in java.lang">getClass</a>, <a href="https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html?is-external=true#hashCode--" title="class or interface in java.lang">hashCode</a>, <a href="https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html?is-external=true#notify--" title="class or interface in java.lang">notify</a>, <a href="https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html?is-external=true#notifyAll--" title="class or interface in java.lang">notifyAll</a>, <a href="https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html?is-external=true#toString--" title="class or interface in java.lang">toString</a>, <a href="https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html?is-external=true#wait--" title="class or interface in java.lang">wait</a>, <a href="https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html?is-external=true#wait-long-" title="class or interface in java.lang">wait</a>, <a href="https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html?is-external=true#wait-long-int-" title="class or interface in java.lang">wait</a></code></li>
</ul>
</li>
</ul>
</li>
</ul>
</div>
<div class="details">
<ul class="blockList">
<li class="blockList">
<!-- ========= CONSTRUCTOR DETAIL ======== -->
<ul class="blockList">
<li class="blockList"><a name="constructor.detail">
<!-- -->
</a>
<h3>Constructor Detail</h3>
<a name="RestServlet--">
<!-- -->
</a>
<ul class="blockListLast">
<li class="blockList">
<h4>RestServlet</h4>
<pre>public&nbsp;<a href="../../../../../src-html/org/apache/juneau/rest/servlet/RestServlet.html#line.62">RestServlet</a>()</pre>
</li>
</ul>
</li>
</ul>
<!-- ============ METHOD DETAIL ========== -->
<ul class="blockList">
<li class="blockList"><a name="method.detail">
<!-- -->
</a>
<h3>Method Detail</h3>
<a name="init-javax.servlet.ServletConfig-">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>init</h4>
<pre>public&nbsp;void&nbsp;<a href="../../../../../src-html/org/apache/juneau/rest/servlet/RestServlet.html#line.70">init</a>(javax.servlet.ServletConfig&nbsp;servletConfig)
throws javax.servlet.ServletException</pre>
<dl>
<dt><span class="overrideSpecifyLabel">Specified by:</span></dt>
<dd><code>init</code>&nbsp;in interface&nbsp;<code>javax.servlet.Servlet</code></dd>
<dt><span class="overrideSpecifyLabel">Overrides:</span></dt>
<dd><code>init</code>&nbsp;in class&nbsp;<code>javax.servlet.GenericServlet</code></dd>
<dt><span class="throwsLabel">Throws:</span></dt>
<dd><code>javax.servlet.ServletException</code></dd>
</dl>
</li>
</ul>
<a name="setContext-org.apache.juneau.rest.RestContext-">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>setContext</h4>
<pre>protected&nbsp;void&nbsp;<a href="../../../../../src-html/org/apache/juneau/rest/servlet/RestServlet.html#line.100">setContext</a>(<a href="../../../../../org/apache/juneau/rest/RestContext.html" title="class in org.apache.juneau.rest">RestContext</a>&nbsp;context)
throws javax.servlet.ServletException</pre>
<div class="block">Sets the context object for this servlet.
<p>
This method is effectively a no-op if <a href="../../../../../org/apache/juneau/rest/servlet/RestServlet.html#init-javax.servlet.ServletConfig-"><code>init(ServletConfig)</code></a> has already been called.</div>
<dl>
<dt><span class="paramLabel">Parameters:</span></dt>
<dd><code>context</code> - Sets the context object on this servlet.</dd>
<dt><span class="throwsLabel">Throws:</span></dt>
<dd><code>javax.servlet.ServletException</code> - If error occurred during initialization.</dd>
</dl>
</li>
</ul>
<a name="getPath--">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>getPath</h4>
<pre>public&nbsp;<a href="https://docs.oracle.com/javase/8/docs/api/java/lang/String.html?is-external=true" title="class or interface in java.lang">String</a>&nbsp;<a href="../../../../../src-html/org/apache/juneau/rest/servlet/RestServlet.html#line.113">getPath</a>()</pre>
<div class="block">Returns the path for this resource as defined by the @Rest(path) annotation or RestContext.Builder.path(String) method
concatenated with those on all parent classes.</div>
<dl>
<dt><span class="returnLabel">Returns:</span></dt>
<dd>The path defined on this servlet, or an empty string if not specified.</dd>
</dl>
</li>
</ul>
<a name="service-javax.servlet.http.HttpServletRequest-javax.servlet.http.HttpServletResponse-">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>service</h4>
<pre>public&nbsp;void&nbsp;<a href="../../../../../src-html/org/apache/juneau/rest/servlet/RestServlet.html#line.134">service</a>(javax.servlet.http.HttpServletRequest&nbsp;r1,
javax.servlet.http.HttpServletResponse&nbsp;r2)
throws javax.servlet.ServletException,
<a href="../../../../../org/apache/juneau/http/response/InternalServerError.html" title="class in org.apache.juneau.http.response">InternalServerError</a>,
<a href="https://docs.oracle.com/javase/8/docs/api/java/io/IOException.html?is-external=true" title="class or interface in java.io">IOException</a></pre>
<div class="block">The main service method.
<p>
Subclasses can optionally override this method if they want to tailor the behavior of requests.</div>
<dl>
<dt><span class="overrideSpecifyLabel">Overrides:</span></dt>
<dd><code>service</code>&nbsp;in class&nbsp;<code>javax.servlet.http.HttpServlet</code></dd>
<dt><span class="throwsLabel">Throws:</span></dt>
<dd><code>javax.servlet.ServletException</code></dd>
<dd><code><a href="../../../../../org/apache/juneau/http/response/InternalServerError.html" title="class in org.apache.juneau.http.response">InternalServerError</a></code></dd>
<dd><code><a href="https://docs.oracle.com/javase/8/docs/api/java/io/IOException.html?is-external=true" title="class or interface in java.io">IOException</a></code></dd>
</dl>
</li>
</ul>
<a name="destroy--">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>destroy</h4>
<pre>public&nbsp;void&nbsp;<a href="../../../../../src-html/org/apache/juneau/rest/servlet/RestServlet.html#line.148">destroy</a>()</pre>
<dl>
<dt><span class="overrideSpecifyLabel">Specified by:</span></dt>
<dd><code>destroy</code>&nbsp;in interface&nbsp;<code>javax.servlet.Servlet</code></dd>
<dt><span class="overrideSpecifyLabel">Overrides:</span></dt>
<dd><code>destroy</code>&nbsp;in class&nbsp;<code>javax.servlet.GenericServlet</code></dd>
</dl>
</li>
</ul>
<a name="getContext--">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>getContext</h4>
<pre>public&nbsp;<a href="../../../../../org/apache/juneau/rest/RestContext.html" title="class in org.apache.juneau.rest">RestContext</a>&nbsp;<a href="../../../../../src-html/org/apache/juneau/rest/servlet/RestServlet.html#line.174">getContext</a>()</pre>
<div class="block">Returns the read-only context object that contains all the configuration information about this resource.
<p>
This object is <jk>null</jk> during the call to <a href="../../../../../org/apache/juneau/rest/servlet/RestServlet.html#init-javax.servlet.ServletConfig-"><code>init(ServletConfig)</code></a> but is populated by the time
<code>GenericServlet.init()</code> is called.
<p>
Resource classes that don't extend from <a href="../../../../../org/apache/juneau/rest/servlet/RestServlet.html" title="class in org.apache.juneau.rest.servlet"><code>RestServlet</code></a> can add the following method to their class to get
access to this context object:
<p class='bjava'>
<jk>public void</jk> init(RestServletContext <jv>context</jv>) <jk>throws</jk> Exception;
</p></div>
<dl>
<dt><span class="returnLabel">Returns:</span></dt>
<dd>The context information on this servlet.</dd>
</dl>
</li>
</ul>
<a name="log-java.util.logging.Level-java.lang.String-java.lang.Object...-">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>log</h4>
<pre>public&nbsp;void&nbsp;<a href="../../../../../src-html/org/apache/juneau/rest/servlet/RestServlet.html#line.195">log</a>(<a href="https://docs.oracle.com/javase/8/docs/api/java/util/logging/Level.html?is-external=true" title="class or interface in java.util.logging">Level</a>&nbsp;level,
<a href="https://docs.oracle.com/javase/8/docs/api/java/lang/String.html?is-external=true" title="class or interface in java.lang">String</a>&nbsp;msg,
<a href="https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html?is-external=true" title="class or interface in java.lang">Object</a>...&nbsp;args)</pre>
<div class="block">Log a message.
<p>
Subclasses can intercept the handling of these messages by overriding <a href="../../../../../org/apache/juneau/rest/servlet/RestServlet.html#doLog-java.util.logging.Level-java.lang.Throwable-java.util.function.Supplier-"><code>doLog(Level, Throwable, Supplier)</code></a>.</div>
<dl>
<dt><span class="paramLabel">Parameters:</span></dt>
<dd><code>level</code> - The log level.</dd>
<dd><code>msg</code> - The message to log.</dd>
<dd><code>args</code> - Optional <a href="https://docs.oracle.com/javase/8/docs/api/java/text/MessageFormat.html?is-external=true" title="class or interface in java.text"><code>MessageFormat</code></a>-style arguments.</dd>
</dl>
</li>
</ul>
<a name="log-java.util.logging.Level-java.lang.Throwable-java.lang.String-java.lang.Object...-">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>log</h4>
<pre>public&nbsp;void&nbsp;<a href="../../../../../src-html/org/apache/juneau/rest/servlet/RestServlet.html#line.210">log</a>(<a href="https://docs.oracle.com/javase/8/docs/api/java/util/logging/Level.html?is-external=true" title="class or interface in java.util.logging">Level</a>&nbsp;level,
<a href="https://docs.oracle.com/javase/8/docs/api/java/lang/Throwable.html?is-external=true" title="class or interface in java.lang">Throwable</a>&nbsp;cause,
<a href="https://docs.oracle.com/javase/8/docs/api/java/lang/String.html?is-external=true" title="class or interface in java.lang">String</a>&nbsp;msg,
<a href="https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html?is-external=true" title="class or interface in java.lang">Object</a>...&nbsp;args)</pre>
<div class="block">Log a message.
<p>
Subclasses can intercept the handling of these messages by overriding <a href="../../../../../org/apache/juneau/rest/servlet/RestServlet.html#doLog-java.util.logging.Level-java.lang.Throwable-java.util.function.Supplier-"><code>doLog(Level, Throwable, Supplier)</code></a>.</div>
<dl>
<dt><span class="paramLabel">Parameters:</span></dt>
<dd><code>level</code> - The log level.</dd>
<dd><code>cause</code> - The cause.</dd>
<dd><code>msg</code> - The message to log.</dd>
<dd><code>args</code> - Optional <a href="https://docs.oracle.com/javase/8/docs/api/java/text/MessageFormat.html?is-external=true" title="class or interface in java.text"><code>MessageFormat</code></a>-style arguments.</dd>
</dl>
</li>
</ul>
<a name="doLog-java.util.logging.Level-java.lang.Throwable-java.util.function.Supplier-">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>doLog</h4>
<pre>protected&nbsp;void&nbsp;<a href="../../../../../src-html/org/apache/juneau/rest/servlet/RestServlet.html#line.227">doLog</a>(<a href="https://docs.oracle.com/javase/8/docs/api/java/util/logging/Level.html?is-external=true" title="class or interface in java.util.logging">Level</a>&nbsp;level,
<a href="https://docs.oracle.com/javase/8/docs/api/java/lang/Throwable.html?is-external=true" title="class or interface in java.lang">Throwable</a>&nbsp;cause,
<a href="https://docs.oracle.com/javase/8/docs/api/java/util/function/Supplier.html?is-external=true" title="class or interface in java.util.function">Supplier</a>&lt;<a href="https://docs.oracle.com/javase/8/docs/api/java/lang/String.html?is-external=true" title="class or interface in java.lang">String</a>&gt;&nbsp;msg)</pre>
<div class="block">Main logger method.
<p>
The default behavior logs a message to the Java logger of the class name.
<p>
Subclasses can override this method to implement their own logger handling.</div>
<dl>
<dt><span class="paramLabel">Parameters:</span></dt>
<dd><code>level</code> - The log level.</dd>
<dd><code>cause</code> - Optional throwable.</dd>
<dd><code>msg</code> - The message to log.</dd>
</dl>
</li>
</ul>
<a name="getRequest--">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>getRequest</h4>
<pre>public&nbsp;<a href="../../../../../org/apache/juneau/rest/RestRequest.html" title="class in org.apache.juneau.rest">RestRequest</a>&nbsp;<a href="../../../../../src-html/org/apache/juneau/rest/servlet/RestServlet.html#line.244">getRequest</a>()</pre>
<div class="block">Returns the current thread-local HTTP request.</div>
<dl>
<dt><span class="returnLabel">Returns:</span></dt>
<dd>The current thread-local HTTP request, or <jk>null</jk> if it wasn't created.</dd>
</dl>
</li>
</ul>
<a name="getResponse--">
<!-- -->
</a>
<ul class="blockListLast">
<li class="blockList">
<h4>getResponse</h4>
<pre>public&nbsp;<a href="../../../../../org/apache/juneau/rest/RestResponse.html" title="class in org.apache.juneau.rest">RestResponse</a>&nbsp;<a href="../../../../../src-html/org/apache/juneau/rest/servlet/RestServlet.html#line.253">getResponse</a>()</pre>
<div class="block">Returns the current thread-local HTTP response.</div>
<dl>
<dt><span class="returnLabel">Returns:</span></dt>
<dd>The current thread-local HTTP response, or <jk>null</jk> if it wasn't created.</dd>
</dl>
</li>
</ul>
</li>
</ul>
</li>
</ul>
</div>
</div>
<!-- ========= END OF CLASS DATA ========= -->
<!-- ======= START OF BOTTOM NAVBAR ====== -->
<div class="bottomNav"><a name="navbar.bottom">
<!-- -->
</a>
<div class="skipNav"><a href="#skip.navbar.bottom" title="Skip navigation links">Skip navigation links</a></div>
<a name="navbar.bottom.firstrow">
<!-- -->
</a>
<ul class="navList" title="Navigation">
<li><a href="../../../../../overview-summary.html">Overview</a></li>
<li><a href="package-summary.html">Package</a></li>
<li class="navBarCell1Rev">Class</li>
<li><a href="package-tree.html">Tree</a></li>
<li><a href="../../../../../deprecated-list.html">Deprecated</a></li>
<li><a href="../../../../../index-all.html">Index</a></li>
<li><a href="../../../../../help-doc.html">Help</a></li>
</ul>
</div>
<div class="subNav">
<ul class="navList">
<li><a href="../../../../../org/apache/juneau/rest/servlet/RestObject.html" title="class in org.apache.juneau.rest.servlet"><span class="typeNameLink">Prev&nbsp;Class</span></a></li>
<li>Next&nbsp;Class</li>
</ul>
<ul class="navList">
<li><a href="../../../../../index.html?org/apache/juneau/rest/servlet/RestServlet.html" target="_top">Frames</a></li>
<li><a href="RestServlet.html" target="_top">No&nbsp;Frames</a></li>
</ul>
<ul class="navList" id="allclasses_navbar_bottom">
<li><a href="../../../../../allclasses-noframe.html">All&nbsp;Classes</a></li>
</ul>
<div>
<script type="text/javascript"><!--
allClassesLink = document.getElementById("allclasses_navbar_bottom");
if(window==top) {
allClassesLink.style.display = "block";
}
else {
allClassesLink.style.display = "none";
}
//-->
</script>
</div>
<div>
<ul class="subNavList">
<li>Summary:&nbsp;</li>
<li>Nested&nbsp;|&nbsp;</li>
<li>Field&nbsp;|&nbsp;</li>
<li><a href="#constructor.summary">Constr</a>&nbsp;|&nbsp;</li>
<li><a href="#method.summary">Method</a></li>
</ul>
<ul class="subNavList">
<li>Detail:&nbsp;</li>
<li>Field&nbsp;|&nbsp;</li>
<li><a href="#constructor.detail">Constr</a>&nbsp;|&nbsp;</li>
<li><a href="#method.detail">Method</a></li>
</ul>
</div>
<a name="skip.navbar.bottom">
<!-- -->
</a></div>
<!-- ======== END OF BOTTOM NAVBAR ======= -->
<p class="legalCopy"><small>Copyright &#169; 2016&#x2013;2022 <a href="https://www.apache.org/">The Apache Software Foundation</a>. All rights reserved.</small></p>
</body>
</html>