01: package de.webman.template.jsp;
02:
03: import javax.servlet.Servlet;
04: import javax.servlet.ServletRequest;
05: import javax.servlet.ServletResponse;
06: import javax.servlet.jsp.*;
07: import org.apache.log4j.Category;
08:
09: /**
10: * @author $Author: alex $
11: * @version $Revision: 1.1 $
12: */
13: public class WebManJspFactory extends JspFactory {
14: private static Category cat = Category
15: .getInstance(WebManJspFactory.class);
16:
17: /**
18: * <p>
19: * obtains an instance of an implementation dependent
20: * javax.servlet.jsp.PageContext abstract class for the calling Servlet
21: * and currently pending request and response.
22: * </p>
23: *
24: * <p>
25: * This method is typically called early in the processing of the
26: * _jspService() mehtod of a JSP implementation class in order to
27: * obtain a PageContext object for the request being processed.
28: * </p>
29: * <p>
30: * Invoking this method shall result in the PageContext.initialize()
31: * method being invoked. The PageContext returned is properly initialized.
32: * </p>
33: * <p>
34: * All PageContext objects obtained via this method shall be released
35: * by invoking releasePageContext().
36: * </p>
37: *
38: * @param servlet the requesting servlet
39: * @param config the ServletConfig for the requesting Servlet
40: * @param request the current request pending on the servlet
41: * @param response the current response pending on the servlet
42: * @param errorPageURL the URL of the error page for the requesting JSP, or null
43: * @param needsSession true if the JSP participates in a session
44: * @param buffer size of buffer in bytes, PageContext.NO_BUFFER if no buffer,
45: * PageContext.DEFAULT_BUFFER if implementation default.
46: * @param autoflush should the buffer autoflush to the output stream on buffer
47: * overflow, or throw an IOException?
48: *
49: * @return the page context
50: *
51: * @see javax.servlet.jsp.PageContext
52: */
53:
54: public PageContext getPageContext(Servlet servlet,
55: ServletRequest request, ServletResponse response,
56: String errorPageURL, boolean needsSession, int buffer,
57: boolean autoflush) {
58: WebManPageContext ctx = new WebManPageContext(this );
59: try {
60: ctx.initialize(servlet, request, response, errorPageURL,
61: false, buffer, autoflush);
62: } catch (Exception e) {
63: cat.error("Exception bei ctx.initialize:", e);
64: }
65: return ctx;
66: }
67:
68: /**
69: * <p>
70: * called to release a previously allocated PageContext object. results
71: * in PageContext.release() being invoked. This method should be invoked
72: * prior to returning from the _jspService() method of a JSP implementation
73: * class.
74: * </p>
75: *
76: * @param pc A PageContext previously obtained by getPageContext()
77: */
78: public void releasePageContext(PageContext pc) {
79: }
80:
81: /**
82: * <p>
83: * called to get implementation-specific information on the current JSP engine
84: * </p>
85: *
86: * @return a JspEngineInfo object describing the current JSP engine
87: */
88: public JspEngineInfo getEngineInfo() {
89: return null;
90: }
91: }
|