int bufferSize,
boolean autoflush) {
try {
- PageContext pc;
- if( USE_POOL ) {
+ PageContext pc;
+ if( USE_POOL ) {
pc = (PageContext) pool.get();
- if( pc == null ) {
- pc= new PageContextImpl(this);
- }
- } else {
- pc = new PageContextImpl(this);
- }
- pc.initialize(servlet, request, response, errorPageURL,
- needsSession, bufferSize, autoflush);
+ if( pc == null ) {
+ pc = new PageContextImpl();
+ }
+ } else {
+ pc = new PageContextImpl();
+ }
+ pc.initialize(servlet, request, response, errorPageURL,
+ needsSession, bufferSize, autoflush);
return pc;
} catch (Throwable ex) {
/* FIXME: need to do something reasonable here!! */
/*
- * Copyright 1999,2004 The Apache Software Foundation.
+ * Copyright 1999,2004-2006 The Apache Software Foundation.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
import java.security.PrivilegedActionException;
import java.security.PrivilegedExceptionAction;
import java.util.Enumeration;
-import java.util.Hashtable;
+import java.util.HashMap;
import javax.el.ELContext;
-import javax.el.ELResolver;
import javax.el.ExpressionFactory;
import javax.el.ValueExpression;
import javax.servlet.Servlet;
import org.apache.jasper.el.FunctionMapperImpl;
import org.apache.jasper.el.VariableResolverImpl;
import org.apache.jasper.security.SecurityUtil;
+import org.apache.jasper.util.Enumerator;
/**
* Implementation of the PageContext class from the JSP spec. Also doubles as a
private ServletContext context;
- private JspFactory factory;
-
private JspApplicationContextImpl applicationContext;
- private boolean needsSession;
-
private String errorPageURL;
- private boolean autoFlush;
-
- private int bufferSize;
-
// page-scope attributes
- private transient Hashtable attributes;
+ private transient HashMap<String, Object> attributes;
// per-request state
private transient ServletRequest request;
private transient ServletResponse response;
- private transient Object page;
-
private transient HttpSession session;
private transient ELContextImpl elContext;
private boolean isIncluded;
- //
-
// initial output stream
private transient JspWriter out;
/*
* Constructor.
*/
- PageContextImpl(JspFactory factory) {
- this.factory = factory;
+ PageContextImpl() {
this.outs = new BodyContentImpl[0];
- this.attributes = new Hashtable(16);
+ this.attributes = new HashMap<String, Object>(16);
this.depth = -1;
}
this.servlet = servlet;
this.config = servlet.getServletConfig();
this.context = config.getServletContext();
- this.needsSession = needsSession;
this.errorPageURL = errorPageURL;
- this.bufferSize = bufferSize;
- this.autoFlush = autoFlush;
this.request = request;
this.response = response;
context = null;
applicationContext = null;
elContext = null;
- needsSession = false;
errorPageURL = null;
- bufferSize = JspWriter.DEFAULT_BUFFER;
- autoFlush = true;
request = null;
response = null;
depth = -1;
private Enumeration doGetAttributeNamesInScope(int scope) {
switch (scope) {
case PAGE_SCOPE:
- return attributes.keys();
+ return new Enumerator(attributes.keySet().iterator());
case REQUEST_SCOPE:
return request.getAttributeNames();