blob: 239372565e42ee54832ac09988d4109fea68bbd9 [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>
<title>HttpServletMapping</title>
<link rel="stylesheet" type="text/css" href="../../../stylesheet.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="HttpServletMapping";
}
}
catch(err) {
}
//-->
var methods = {"i0":6,"i1":6,"i2":6,"i3":6};
var tabs = {65535:["t0","All Methods"],2:["t2","Instance Methods"],4:["t3","Abstract 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="../../../jakarta/servlet/http/HttpServlet.html" title="class in jakarta.servlet.http"><span class="typeNameLink">Prev&nbsp;Class</span></a></li>
<li><a href="../../../jakarta/servlet/http/HttpServletRequest.html" title="interface in jakarta.servlet.http"><span class="typeNameLink">Next&nbsp;Class</span></a></li>
</ul>
<ul class="navList">
<li><a href="../../../index.html?jakarta/servlet/http/HttpServletMapping.html" target="_top">Frames</a></li>
<li><a href="HttpServletMapping.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>Constr&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>Constr&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">jakarta.servlet.http</div>
<h2 title="Interface HttpServletMapping" class="title">Interface HttpServletMapping</h2>
</div>
<div class="contentContainer">
<div class="description">
<ul class="blockList">
<li class="blockList">
<hr>
<br>
<pre>public interface <span class="typeNameLabel">HttpServletMapping</span></pre>
<div class="block"><p>
Allows runtime discovery of the manner in which the <a href="../../../jakarta/servlet/http/HttpServlet.html" title="class in jakarta.servlet.http"><code>HttpServlet</code></a> for the current <a href="../../../jakarta/servlet/http/HttpServletRequest.html" title="interface in jakarta.servlet.http"><code>HttpServletRequest</code></a>
was invoked. Invoking any of the methods must not block the caller. The implementation must be thread safe. Instances
are immutable and are returned from <a href="../../../jakarta/servlet/http/HttpServletRequest.html#getHttpServletMapping--"><code>HttpServletRequest.getHttpServletMapping()</code></a>.
</p>
<p>
Following are some illustrative examples for various combinations of mappings. Consider the following Servlet
declaration:
</p>
<pre>
<code>
&lt;servlet&gt;
&lt;servlet-name&gt;MyServlet&lt;/servlet-name&gt;
&lt;servlet-class&gt;MyServlet&lt;/servlet-class&gt;
&lt;/servlet&gt;
&lt;servlet-mapping&gt;
&lt;servlet-name&gt;MyServlet&lt;/servlet-name&gt;
&lt;url-pattern&gt;/MyServlet&lt;/url-pattern&gt;
&lt;url-pattern&gt;""&lt;/url-pattern&gt;
&lt;url-pattern&gt;*.extension&lt;/url-pattern&gt;
&lt;url-pattern&gt;/path/*&lt;/url-pattern&gt;
&lt;/servlet-mapping&gt;
</code>
</pre>
<p>
The expected values of the properties for various incoming URI path values are as shown in this table. The
<code>servletName</code> column is omitted as its value is always <code>MyServlet</code>.
</p>
<table border="1">
<caption>Expected values of properties for various URI paths</caption>
<tr>
<th>URI Path (in quotes)</th>
<th>matchValue</th>
<th>pattern</th>
<th>mappingMatch</th>
</tr>
<tr>
<td>""</td>
<td>""</td>
<td>""</td>
<td>CONTEXT_ROOT</td>
</tr>
<tr>
<td>"/index.html"</td>
<td>""</td>
<td>/</td>
<td>DEFAULT</td>
</tr>
<tr>
<td>"/MyServlet"</td>
<td>MyServlet</td>
<td>/MyServlet</td>
<td>EXACT</td>
</tr>
<tr>
<td>"/foo.extension"</td>
<td>foo</td>
<td>*.extension</td>
<td>EXTENSION</td>
</tr>
<tr>
<td>"/path/foo"</td>
<td>foo</td>
<td>/path/*</td>
<td>PATH</td>
</tr>
</table></div>
<dl>
<dt><span class="simpleTagLabel">Since:</span></dt>
<dd>4.0</dd>
</dl>
</li>
</ul>
</div>
<div class="summary">
<ul class="blockList">
<li class="blockList">
<!-- ========== 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="t3" class="tableTab"><span><a href="javascript:show(4);">Abstract 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><a href="../../../jakarta/servlet/http/MappingMatch.html" title="enum in jakarta.servlet.http">MappingMatch</a></code></td>
<td class="colLast"><code><span class="memberNameLink"><a href="../../../jakarta/servlet/http/HttpServletMapping.html#getMappingMatch--">getMappingMatch</a></span>()</code>
<div class="block">
Return the <a href="../../../jakarta/servlet/http/MappingMatch.html" title="enum in jakarta.servlet.http"><code>MappingMatch</code></a> for this instance</div>
</td>
</tr>
<tr id="i1" class="rowColor">
<td class="colFirst"><code>java.lang.String</code></td>
<td class="colLast"><code><span class="memberNameLink"><a href="../../../jakarta/servlet/http/HttpServletMapping.html#getMatchValue--">getMatchValue</a></span>()</code>
<div class="block">
Return the portion of the URI path that caused this request to be matched.</div>
</td>
</tr>
<tr id="i2" class="altColor">
<td class="colFirst"><code>java.lang.String</code></td>
<td class="colLast"><code><span class="memberNameLink"><a href="../../../jakarta/servlet/http/HttpServletMapping.html#getPattern--">getPattern</a></span>()</code>
<div class="block">
Return the String representation for the <code>url-pattern</code> for this mapping.</div>
</td>
</tr>
<tr id="i3" class="rowColor">
<td class="colFirst"><code>java.lang.String</code></td>
<td class="colLast"><code><span class="memberNameLink"><a href="../../../jakarta/servlet/http/HttpServletMapping.html#getServletName--">getServletName</a></span>()</code>
<div class="block">
Return the String representation for the <code>servlet-name</code> for this mapping.</div>
</td>
</tr>
</table>
</li>
</ul>
</li>
</ul>
</div>
<div class="details">
<ul class="blockList">
<li class="blockList">
<!-- ============ METHOD DETAIL ========== -->
<ul class="blockList">
<li class="blockList"><a name="method.detail">
<!-- -->
</a>
<h3>Method Detail</h3>
<a name="getMatchValue--">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>getMatchValue</h4>
<pre>java.lang.String&nbsp;getMatchValue()</pre>
<div class="block"><p>
Return the portion of the URI path that caused this request to be matched. If the <a href="../../../jakarta/servlet/http/HttpServletMapping.html#getMappingMatch--"><code>getMappingMatch()</code></a> value is
<code>CONTEXT_ROOT</code> or <code>DEFAULT</code>, this method must return the empty string. If the <a href="../../../jakarta/servlet/http/HttpServletMapping.html#getMappingMatch--"><code>getMappingMatch()</code></a> value is
<code>EXACT</code>, this method must return the portion of the path that matched the servlet, omitting any leading slash. If the
<a href="../../../jakarta/servlet/http/HttpServletMapping.html#getMappingMatch--"><code>getMappingMatch()</code></a> value is <code>EXTENSION</code> or <code>PATH</code>, this method must return the value that matched
the '*'. See the class javadoc for examples.
</p></div>
<dl>
<dt><span class="returnLabel">Returns:</span></dt>
<dd>the match.</dd>
<dt><span class="simpleTagLabel">Since:</span></dt>
<dd>4.0</dd>
</dl>
</li>
</ul>
<a name="getPattern--">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>getPattern</h4>
<pre>java.lang.String&nbsp;getPattern()</pre>
<div class="block"><p>
Return the String representation for the <code>url-pattern</code> for this mapping. If the <a href="../../../jakarta/servlet/http/HttpServletMapping.html#getMappingMatch--"><code>getMappingMatch()</code></a> value
is <code>CONTEXT_ROOT</code>, this method must return the empty string. If the <a href="../../../jakarta/servlet/http/HttpServletMapping.html#getMappingMatch--"><code>getMappingMatch()</code></a> value is <code>EXTENSION</code>, this method must return the pattern, without any leading slash. Otherwise, this method returns the
pattern exactly as specified in the descriptor or Java configuration.
</p></div>
<dl>
<dt><span class="returnLabel">Returns:</span></dt>
<dd>the String representation for the <code>url-pattern</code> for this mapping.</dd>
<dt><span class="simpleTagLabel">Since:</span></dt>
<dd>4.0</dd>
</dl>
</li>
</ul>
<a name="getServletName--">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>getServletName</h4>
<pre>java.lang.String&nbsp;getServletName()</pre>
<div class="block"><p>
Return the String representation for the <code>servlet-name</code> for this mapping. If the Servlet providing the response
is the default servlet, the return from this method is the name of the default servlet, which is container specific.
</p></div>
<dl>
<dt><span class="returnLabel">Returns:</span></dt>
<dd>the String representation for the <code>servlet-name</code> for this mapping.</dd>
<dt><span class="simpleTagLabel">Since:</span></dt>
<dd>4.0</dd>
</dl>
</li>
</ul>
<a name="getMappingMatch--">
<!-- -->
</a>
<ul class="blockListLast">
<li class="blockList">
<h4>getMappingMatch</h4>
<pre><a href="../../../jakarta/servlet/http/MappingMatch.html" title="enum in jakarta.servlet.http">MappingMatch</a>&nbsp;getMappingMatch()</pre>
<div class="block"><p>
Return the <a href="../../../jakarta/servlet/http/MappingMatch.html" title="enum in jakarta.servlet.http"><code>MappingMatch</code></a> for this instance
</p></div>
<dl>
<dt><span class="returnLabel">Returns:</span></dt>
<dd>the <code>MappingMatch</code> for this instance.</dd>
<dt><span class="simpleTagLabel">Since:</span></dt>
<dd>4.0</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="../../../jakarta/servlet/http/HttpServlet.html" title="class in jakarta.servlet.http"><span class="typeNameLink">Prev&nbsp;Class</span></a></li>
<li><a href="../../../jakarta/servlet/http/HttpServletRequest.html" title="interface in jakarta.servlet.http"><span class="typeNameLink">Next&nbsp;Class</span></a></li>
</ul>
<ul class="navList">
<li><a href="../../../index.html?jakarta/servlet/http/HttpServletMapping.html" target="_top">Frames</a></li>
<li><a href="HttpServletMapping.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>Constr&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>Constr&nbsp;|&nbsp;</li>
<li><a href="#method.detail">Method</a></li>
</ul>
</div>
<a name="skip.navbar.bottom">
<!-- -->
</a></div>
<!-- ======== END OF BOTTOM NAVBAR ======= -->
</body>
</html>