blob: dc5215410b6aaf88a72e08717b42fe703a60141a [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>JspApplicationContext</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="JspApplicationContext";
}
}
catch(err) {
}
//-->
var methods = {"i0":6,"i1":6,"i2":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="../../../javax/servlet/jsp/HttpJspPage.html" title="interface in javax.servlet.jsp"><span class="typeNameLink">Prev&nbsp;Class</span></a></li>
<li><a href="../../../javax/servlet/jsp/JspContext.html" title="class in javax.servlet.jsp"><span class="typeNameLink">Next&nbsp;Class</span></a></li>
</ul>
<ul class="navList">
<li><a href="../../../index.html?javax/servlet/jsp/JspApplicationContext.html" target="_top">Frames</a></li>
<li><a href="JspApplicationContext.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">javax.servlet.jsp</div>
<h2 title="Interface JspApplicationContext" class="title">Interface JspApplicationContext</h2>
</div>
<div class="contentContainer">
<div class="description">
<ul class="blockList">
<li class="blockList">
<hr>
<br>
<pre>public interface <span class="typeNameLabel">JspApplicationContext</span></pre>
<div class="block">Stores application-scoped information relevant to JSP containers.
<p>
The JSP container must create a single instance of <code>JspApplicationContext</code> for each
<code>ServletContext</code> instance.
</p>
<p>
An instance of <code>JspApplicationContext</code> is obtained by invoking the static
<a href="../../../javax/servlet/jsp/JspFactory.html#getJspApplicationContext-javax.servlet.ServletContext-"><code>JspFactory.getJspApplicationContext(javax.servlet.ServletContext)</code></a> method, passing the <code>ServletContext</code> of the corresponding web
application.
</p>
<p>
The <code>JspApplicationContext</code> provides the following services to JSP applications:
</p>
<ul>
<li>Allows registration of <code>ELResolver</code>s, which are used to resolve variables in EL expressions contained
in JSP pages and tag files.</li>
<li>Provides an instance of <code>ExpressionFactory</code> for those applications or frameworks that need to perform
programmatic evaluation of EL expressions instead of allowing the JSP container to do it for them.</li>
<li>Allows the attachment of <code>ELContextListener</code> instances for notification whenever a new
<code>ELContext</code> is created. This is necessary when an application wishes to make custom context objects
available to their pluggable <code>ELResolver</code>s.</li>
</ul></div>
<dl>
<dt><span class="simpleTagLabel">Since:</span></dt>
<dd>JSP 2.1</dd>
<dt><span class="seeLabel">See Also:</span></dt>
<dd><a href="../../../javax/servlet/ServletContext.html" title="interface in javax.servlet"><code>ServletContext</code></a>,
<a href="../../../javax/servlet/jsp/JspFactory.html" title="class in javax.servlet.jsp"><code>JspFactory</code></a>,
<code>javax.el.ELResolver</code>,
<code>javax.el.ExpressionFactory</code>,
<code>javax.el.ELContextListener</code></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>void</code></td>
<td class="colLast"><code><span class="memberNameLink"><a href="../../../javax/servlet/jsp/JspApplicationContext.html#addELContextListener-ELContextListener-">addELContextListener</a></span>(ELContextListener&nbsp;listener)</code>
<div class="block">Registers a <code>ELContextListener</code>s so that context objects can be added whenever a new
<code>ELContext</code> is created.</div>
</td>
</tr>
<tr id="i1" class="rowColor">
<td class="colFirst"><code>void</code></td>
<td class="colLast"><code><span class="memberNameLink"><a href="../../../javax/servlet/jsp/JspApplicationContext.html#addELResolver-ELResolver-">addELResolver</a></span>(ELResolver&nbsp;resolver)</code>
<div class="block">Adds an <code>ELResolver</code> to affect the way EL variables and properties are resolved for EL expressions
appearing in JSP pages and tag files.</div>
</td>
</tr>
<tr id="i2" class="altColor">
<td class="colFirst"><code>ExpressionFactory</code></td>
<td class="colLast"><code><span class="memberNameLink"><a href="../../../javax/servlet/jsp/JspApplicationContext.html#getExpressionFactory--">getExpressionFactory</a></span>()</code>
<div class="block">Returns a factory used to create <code>ValueExpression</code>s and <code>MethodExpression</code>s so that EL
expressions can be parsed and evaluated.</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="addELResolver-ELResolver-">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>addELResolver</h4>
<pre>void&nbsp;addELResolver(ELResolver&nbsp;resolver)</pre>
<div class="block">Adds an <code>ELResolver</code> to affect the way EL variables and properties are resolved for EL expressions
appearing in JSP pages and tag files.
<p>
For example, in the EL expression ${employee.lastName}, an <code>ELResolver</code> determines what object
"employee" references and how to find its "lastName" property.
</p>
<p>
When evaluating an expression, the JSP container will consult a set of standard resolvers as well as any
resolvers registered via this method. The set of resolvers are consulted in the following order:
</p>
<ul>
<li><a href="../../../javax/servlet/jsp/el/ImplicitObjectELResolver.html" title="class in javax.servlet.jsp.el"><code>ImplicitObjectELResolver</code></a></li>
<li><code>ELResolver</code>s registered via this method, in the order in which they are registered.</li>
<li><code>javax.el.MapELResolver</code></li>
<li><code>javax.el.ListELResolver</code></li>
<li><code>javax.el.ArrayELResolver</code></li>
<li><code>javax.el.BeanELResolver</code></li>
<li><a href="../../../javax/servlet/jsp/el/ScopedAttributeELResolver.html" title="class in javax.servlet.jsp.el"><code>ScopedAttributeELResolver</code></a></li>
</ul>
<p>
It is illegal to register an <code>ELResolver</code> after the application has received any request from the
client. If an attempt is made to register an <code>ELResolver</code> after that time, an
<code>IllegalStateException</code> is thrown.
</p>
<p>
This restriction is in place to allow the JSP container to optimize for the common case where no additional
<code>ELResolver</code>s are in the chain, aside from the standard ones. It is permissible to add
<code>ELResolver</code>s before or after initialization to a <code>CompositeELResolver</code> that is already in
the chain.
</p>
<p>
It is not possible to remove an <code>ELResolver</code> registered with this method, once it has been registered.
</p></div>
<dl>
<dt><span class="paramLabel">Parameters:</span></dt>
<dd><code>resolver</code> - The new <code>ELResolver</code></dd>
<dt><span class="throwsLabel">Throws:</span></dt>
<dd><code>java.lang.IllegalStateException</code> - if an attempt is made to call this method after all
<code>ServletContextListener</code>s have had their <code>contextInitialized</code>
methods invoked.</dd>
</dl>
</li>
</ul>
<a name="getExpressionFactory--">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>getExpressionFactory</h4>
<pre>ExpressionFactory&nbsp;getExpressionFactory()</pre>
<div class="block">Returns a factory used to create <code>ValueExpression</code>s and <code>MethodExpression</code>s so that EL
expressions can be parsed and evaluated.</div>
<dl>
<dt><span class="returnLabel">Returns:</span></dt>
<dd>A concrete implementation of the an <code>ExpressionFactory</code>.</dd>
</dl>
</li>
</ul>
<a name="addELContextListener-ELContextListener-">
<!-- -->
</a>
<ul class="blockListLast">
<li class="blockList">
<h4>addELContextListener</h4>
<pre>void&nbsp;addELContextListener(ELContextListener&nbsp;listener)</pre>
<div class="block">Registers a <code>ELContextListener</code>s so that context objects can be added whenever a new
<code>ELContext</code> is created.
<p>
At a minimum, the <code>ELContext</code> objects created will contain a reference to the <code>JspContext</code>
for this request, which is added by the JSP container. This is sufficient for all the default
<code>ELResolver</code>s listed in <a href="../../../javax/servlet/jsp/JspApplicationContext.html#addELResolver-ELResolver-"><code>addELResolver(ELResolver)</code></a>. Note that <code>JspContext.class</code> is used as the
key to ELContext.putContext() for the <code>JspContext</code> object reference.
</p>
<p>
This method is generally used by frameworks and applications that register their own <code>ELResolver</code> that
needs context other than <code>JspContext</code>. The listener will typically add the necessary context to the
<code>ELContext</code> provided in the event object. Registering a listener that adds context allows the
<code>ELResolver</code>s in the stack to access the context they need when they do a resolution.
</p></div>
<dl>
<dt><span class="paramLabel">Parameters:</span></dt>
<dd><code>listener</code> - The listener to be notified when a new <code>ELContext</code> is 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="../../../javax/servlet/jsp/HttpJspPage.html" title="interface in javax.servlet.jsp"><span class="typeNameLink">Prev&nbsp;Class</span></a></li>
<li><a href="../../../javax/servlet/jsp/JspContext.html" title="class in javax.servlet.jsp"><span class="typeNameLink">Next&nbsp;Class</span></a></li>
</ul>
<ul class="navList">
<li><a href="../../../index.html?javax/servlet/jsp/JspApplicationContext.html" target="_top">Frames</a></li>
<li><a href="JspApplicationContext.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>