001 /* 002 * Licensed to the Apache Software Foundation (ASF) under one or more 003 * contributor license agreements. See the NOTICE file distributed with 004 * this work for additional information regarding copyright ownership. 005 * The ASF licenses this file to You under the Apache License, Version 2.0 006 * (the "License"); you may not use this file except in compliance with 007 * the License. You may obtain a copy of the License at 008 * 009 * http://www.apache.org/licenses/LICENSE-2.0 010 * 011 * Unless required by applicable law or agreed to in writing, software 012 * distributed under the License is distributed on an "AS IS" BASIS, 013 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 014 * See the License for the specific language governing permissions and 015 * limitations under the License. 016 */ 017 package javax.servlet.jsp; 018 019 import javax.el.ELContextListener; 020 import javax.el.ELResolver; 021 import javax.el.ExpressionFactory; 022 023 /** 024 * <p> 025 * Stores <i>application</i>-scoped information for the JSP container. 026 * </p> 027 * @since 2.1 028 */ 029 public interface JspApplicationContext { 030 031 /** 032 * <p> 033 * Registers an <code>ELContextListener</code> that will notified whenever 034 * a new <code>ELContext</code> is created. 035 * </p> 036 * <p> 037 * At the very least, any <code>ELContext</code> instantiated will have reference 038 * to the <code>JspContext</code> under <code>JspContext.class</code>. 039 * </p> 040 * 041 * @param listener 042 */ 043 public void addELContextListener(ELContextListener listener); 044 045 /** 046 * <p> 047 * Adds an <code>ELResolver</code> to the chain of EL variable and property management 048 * within JSP pages and Tag files. 049 * </p> 050 * <p> 051 * JSP has a default set of ELResolvers to chain for all EL evaluation: 052 * <ul> 053 * <li><code>ImplicitObjectELResolver</code></li> 054 * <li><code>ELResolver</code> instances registered with this method</li> 055 * <li><code>MapELResolver</code></li> 056 * <li><code>ListELResolver</code></li> 057 * <li><code>ArrayELResolver</code></li> 058 * <li><code>BeanELResolver</code></li> 059 * <li><code>ScopedAttributeELResolver</code></li> 060 * </ul> 061 * </p> 062 * 063 * @param resolver an additional resolver 064 * @throws IllegalStateException if called after the application's <code>ServletContextListeners</code> have been initialized. 065 */ 066 public void addELResolver(ELResolver resolver) throws IllegalStateException; 067 068 /** 069 * <p> 070 * Returns the JSP container's <code>ExpressionFactory</code> implementation for EL use. 071 * </p> 072 * 073 * @return an <code>ExpressionFactory</code> implementation 074 */ 075 public ExpressionFactory getExpressionFactory(); 076 077 }