org.melati.servlet
Class JspServlet

Package class diagram package JspServlet
java.lang.Object
  extended by javax.servlet.GenericServlet
      extended by javax.servlet.http.HttpServlet
          extended by org.melati.servlet.JspServlet
All Implemented Interfaces:
Serializable, javax.servlet.jsp.HttpJspPage, javax.servlet.jsp.JspPage, javax.servlet.Servlet, javax.servlet.ServletConfig

public abstract class JspServlet
extends javax.servlet.http.HttpServlet
implements javax.servlet.jsp.HttpJspPage

This is a TOY and does not represent the proper way to use Melati as Melati was designed with a template engine in mind. To use extend this class.

Author:
timp At paneris.org
See Also:
Serialized Form

Constructor Summary
JspServlet()
           
 
Method Summary
protected  void _jspDestroy()
           
 void _jspInit()
          Do nothing.
abstract  void _jspService(javax.servlet.http.HttpServletRequest request, javax.servlet.http.HttpServletResponse response)
          This method is overridden by the code generated from the .jsp file.
 void destroy()
          
protected  MelatiConfig getMelatiConfig()
          Override this to tailor your configuration.
protected  PoemContext getPoemContext()
          Override this to supply a PoemContext with at least a database field filled.
protected  PoemContext getPoemContext(String logicalDatabase)
           
protected  PoemContext getPoemContext(String logicalDatabase, String pathInfo)
           
 String getServletInfo()
          
 void init(javax.servlet.ServletConfig config)
          Initialise Melati.
 void jspDestroy()
          
 void jspInit()
          
 void service(javax.servlet.http.HttpServletRequest request, javax.servlet.http.HttpServletResponse response)
          Run the generated code within a database session.
 
Methods inherited from class javax.servlet.http.HttpServlet
doDelete, doGet, doHead, doOptions, doPost, doPut, doTrace, getLastModified, service
 
Methods inherited from class javax.servlet.GenericServlet
getInitParameter, getInitParameterNames, getServletConfig, getServletContext, getServletName, init, log, log
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface javax.servlet.Servlet
getServletConfig, service
 

Constructor Detail

JspServlet

public JspServlet()
Method Detail

init

public void init(javax.servlet.ServletConfig config)
          throws javax.servlet.ServletException
Initialise Melati.

Specified by:
init in interface javax.servlet.Servlet
Overrides:
init in class javax.servlet.GenericServlet
Parameters:
config - a ServletConfig
Throws:
javax.servlet.ServletException - is anything goes wrong

getMelatiConfig

protected MelatiConfig getMelatiConfig()
Override this to tailor your configuration.

Returns:
a configured MelatiConfig

jspInit

public void jspInit()

Specified by:
jspInit in interface javax.servlet.jsp.JspPage
See Also:
JspPage.jspInit()

_jspInit

public void _jspInit()
Do nothing.


getServletInfo

public String getServletInfo()

Specified by:
getServletInfo in interface javax.servlet.Servlet
Overrides:
getServletInfo in class javax.servlet.GenericServlet
See Also:
Servlet.getServletInfo()

destroy

public final void destroy()

Specified by:
destroy in interface javax.servlet.Servlet
Overrides:
destroy in class javax.servlet.GenericServlet
See Also:
Servlet.destroy()

jspDestroy

public void jspDestroy()

Specified by:
jspDestroy in interface javax.servlet.jsp.JspPage
See Also:
JspPage.jspDestroy()

_jspDestroy

protected void _jspDestroy()

_jspService

public abstract void _jspService(javax.servlet.http.HttpServletRequest request,
                                 javax.servlet.http.HttpServletResponse response)
                          throws javax.servlet.ServletException,
                                 IOException
This method is overridden by the code generated from the .jsp file.

Specified by:
_jspService in interface javax.servlet.jsp.HttpJspPage
Throws:
javax.servlet.ServletException
IOException
See Also:
HttpJspPage._jspService(javax.servlet.http.HttpServletRequest, javax.servlet.http.HttpServletResponse)

service

public final void service(javax.servlet.http.HttpServletRequest request,
                          javax.servlet.http.HttpServletResponse response)
                   throws javax.servlet.ServletException
Run the generated code within a database session. Poem requires that any access to the db be associated with a user. We just supply it with the superuser to bypass Melati's access handling.

Overrides:
service in class javax.servlet.http.HttpServlet
Throws:
javax.servlet.ServletException
See Also:
HttpServlet.service(javax.servlet.http.HttpServletRequest, javax.servlet.http.HttpServletResponse)

getPoemContext

protected PoemContext getPoemContext()
Override this to supply a PoemContext with at least a database field filled. protected PoemContext getPoemContext() { return getPoemContext("mydatabase"); }

Returns:
a new context

getPoemContext

protected PoemContext getPoemContext(String logicalDatabase)

getPoemContext

protected PoemContext getPoemContext(String logicalDatabase,
                                     String pathInfo)
                              throws PathInfoException
Throws:
PathInfoException


Copyright © 2000-2010 PanEris. All Rights Reserved.