01: /*
02: * Copyright 2001 Sun Microsystems, Inc. All rights reserved.
03: * PROPRIETARY/CONFIDENTIAL. Use of this product is subject to license terms.
04: */
05:
06: package com.sun.portal.providers.jsp;
07:
08: import javax.servlet.ServletRequest;
09: import javax.servlet.ServletResponse;
10: import javax.servlet.Servlet;
11: import javax.servlet.jsp.PageContext;
12:
13: /*
14: * The JspFactoryImpl implements the JspFactory interface. This
15: * version extends the Jasper JspFactoryImpl by inserting the
16: * "JSPProvider" attribute into the pageContext before it is returned
17: * to the JSP servlet. This allows the JSP to access the JSPProvider
18: * object.
19: **/
20: class JspFactoryImpl
21: extends
22: com.sun.portal.providers.jsp.jasper3.jasper.runtime.JspFactoryImpl {
23: public static final String providerKey = "com.sun.portal.providers.jsp.JSPProvider";
24:
25: public PageContext getPageContext(Servlet servlet,
26: ServletRequest request, ServletResponse response,
27: String errorPageURL, boolean needsSession, int bufferSize,
28: boolean autoflush) {
29: PageContext pc = super .getPageContext(servlet, request,
30: response, errorPageURL, needsSession, bufferSize,
31: autoflush);
32: if (request instanceof Request) {
33: pc.setAttribute("JSPProvider", request
34: .getAttribute(providerKey));
35: }
36: return pc;
37: }
38:
39: }
|