KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > de > webman > template > jsp > WebManJspFactory


1 package de.webman.template.jsp;
2
3 import javax.servlet.Servlet JavaDoc;
4 import javax.servlet.ServletRequest JavaDoc;
5 import javax.servlet.ServletResponse JavaDoc;
6 import javax.servlet.jsp.*;
7 import org.apache.log4j.Category;
8
9 /**
10  * @author $Author: alex $
11  * @version $Revision: 1.1 $
12  */

13 public class WebManJspFactory extends JspFactory
14 {
15     private static Category cat = Category.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 JavaDoc servlet,
55                                ServletRequest JavaDoc request,
56                                ServletResponse JavaDoc response,
57                                String JavaDoc errorPageURL,
58                                boolean needsSession,
59                                int buffer,
60                                boolean autoflush)
61     {
62         WebManPageContext ctx = new WebManPageContext(this);
63         try
64         {
65             ctx.initialize(servlet, request, response,errorPageURL, false, buffer, autoflush);
66         }
67         catch (Exception JavaDoc e)
68         {
69             cat.error("Exception bei ctx.initialize:", e);
70         }
71         return ctx;
72     }
73
74     /**
75      * <p>
76      * called to release a previously allocated PageContext object. results
77      * in PageContext.release() being invoked. This method should be invoked
78      * prior to returning from the _jspService() method of a JSP implementation
79      * class.
80      * </p>
81      *
82      * @param pc A PageContext previously obtained by getPageContext()
83      */

84     public void releasePageContext(PageContext pc)
85     {}
86
87     /**
88      * <p>
89      * called to get implementation-specific information on the current JSP engine
90      * </p>
91      *
92      * @return a JspEngineInfo object describing the current JSP engine
93      */

94     public JspEngineInfo getEngineInfo()
95     {
96         return null;
97     }
98 }
99
Popular Tags