com.caucho.jsp
Class QServlet

java.lang.Object
  |
  +--javax.servlet.GenericServlet
        |
        +--com.caucho.jsp.QServlet
All Implemented Interfaces:
java.io.Serializable, Servlet, ServletConfig
Direct Known Subclasses:
JspServlet, XtpServlet

public abstract class QServlet
extends GenericServlet

Base servlet for both JSP and XTP. It's primarily responsible for returning the proper error messages when things go wrong.

The manager create the compiled JSP and XTP pages. The manager returns a Page object which is actually executed.

See Also:
JspManager, XtpManager, Page, Serialized Form

Field Summary
protected  CauchoApplication application
           
 
Constructor Summary
QServlet()
           
 
Method Summary
 void destroy()
          Called when the servlet (and the application) shuts down.
 Page getPage(CauchoRequest request, CauchoResponse response)
          Creates and returns a new page.
 ServletContext getServletContext()
          Override the Servlet method to return the generated application.
 void init(ServletConfig config)
          Initialize the servlet.
 void service(ServletRequest req, ServletResponse res)
          The service method gets the JSP/XTP page and executes it.
protected  void setManager(PageManager manager)
          JspServlet and XtpServlet will set the PageManager with this method.
 
Methods inherited from class javax.servlet.GenericServlet
getInitParameter, getInitParameterNames, getServletConfig, getServletInfo, getServletName, init, log, log
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

application

protected CauchoApplication application
Constructor Detail

QServlet

public QServlet()
Method Detail

init

public void init(ServletConfig config)
          throws ServletException
Initialize the servlet. If necessary, convert the ServletContext to a CauchoApplication. Also, read the configuration Registry it it hasn't been read yet.
Overrides:
init in class GenericServlet
Following copied from class: javax.servlet.GenericServlet
Parameters:
config - the servlet's configuration

setManager

protected void setManager(PageManager manager)
JspServlet and XtpServlet will set the PageManager with this method.

getServletContext

public ServletContext getServletContext()
Override the Servlet method to return the generated application.
Overrides:
getServletContext in class GenericServlet

service

public void service(ServletRequest req,
                    ServletResponse res)
             throws ServletException,
                    java.io.IOException
The service method gets the JSP/XTP page and executes it. The request and response objects are converted to Caucho objects so other servlet runners will produce the same results as the Caucho servlet runner.
Following copied from interface: javax.servlet.Servlet
Parameters:
req - request information. Normally servlets will cast this to HttpServletRequest
res - response information. Normally servlets will cast this to HttpServletRequest

getPage

public Page getPage(CauchoRequest request,
                    CauchoResponse response)
             throws java.lang.Exception
Creates and returns a new page.
Parameters:
request - the servlet request
response - the servlet response
Returns:
the compiled page

destroy

public void destroy()
Description copied from class: GenericServlet
Called when the servlet (and the application) shuts down.
Overrides:
destroy in class GenericServlet