org.melati.servlet
Class PoemServlet

Package class diagram package PoemServlet
java.lang.Object
  extended by javax.servlet.GenericServlet
      extended by javax.servlet.http.HttpServlet
          extended by org.melati.servlet.ConfigServlet
              extended by org.melati.servlet.PoemServlet
All Implemented Interfaces:
Serializable, javax.servlet.Servlet, javax.servlet.ServletConfig
Direct Known Subclasses:
PoemServletTest, TemplateServlet

public abstract class PoemServlet
extends ConfigServlet

Base class to use Poem with Servlets.

Simply extend this class and override the doPoemRequest method. If you are going to use a template engine look at TemplateServlet.

See Also:
Database.guestAccessToken(), PoemThread.commit(), PoemThread.rollback(), poemContext(org.melati.Melati), AccessHandler, HttpSessionAccessHandler, Login, HttpBasicAuthenticationAccessHandler, Serialized Form

Field Summary
 
Fields inherited from class org.melati.servlet.ConfigServlet
melatiConfig, sysAdminEmail, sysAdminName
 
Constructor Summary
PoemServlet()
           
 
Method Summary
protected  void _handleException(Melati melati, Exception exception)
           
 void destroy()
           
protected  void doConfiguredRequest(Melati melati)
          Process the request.
protected abstract  void doPoemRequest(Melati melati)
          Override this method to build up your own output.
 String getSysAdminEmail()
          Override this to provide a different administrator's details to the database admin user.
 String getSysAdminName()
          Override this to provide a different administrator's details to the database admin user.
protected  void handleException(Melati melati, Exception exception)
          Default method to handle an exception without a template engine.
protected  PoemContext poemContext(Melati melati)
           
protected  PoemContext poemContextWithLDB(Melati melati, String logicalDatabase)
           
protected  void prePoemSession(Melati melati)
          A place to do things before entering the session of the user, here is a good place to use root access token.
 
Methods inherited from class org.melati.servlet.ConfigServlet
doGet, doPost, error, httpStatusCode, init, melatiConfig, setSysAdminEmail, setSysAdminName, writeConnectionPendingException, writeError
 
Methods inherited from class javax.servlet.http.HttpServlet
doDelete, doHead, doOptions, doPut, doTrace, getLastModified, service, service
 
Methods inherited from class javax.servlet.GenericServlet
getInitParameter, getInitParameterNames, getServletConfig, getServletContext, getServletInfo, getServletName, init, log, log
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

PoemServlet

public PoemServlet()
Method Detail

prePoemSession

protected void prePoemSession(Melati melati)
                       throws Exception
A place to do things before entering the session of the user, here is a good place to use root access token. Overriden in TemplateServlet.

Parameters:
melati - org.melati.Melati A source of information about the Melati database context (database, table, object) and utility objects such as error handlers.
Throws:
Exception

destroy

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

doConfiguredRequest

protected void doConfiguredRequest(Melati melati)
                            throws javax.servlet.ServletException,
                                   IOException
Process the request.

Specified by:
doConfiguredRequest in class ConfigServlet
Throws:
javax.servlet.ServletException
IOException

getSysAdminName

public String getSysAdminName()
Override this to provide a different administrator's details to the database admin user.

Overrides:
getSysAdminName in class ConfigServlet
Returns:
the System Administrators name.

getSysAdminEmail

public String getSysAdminEmail()
Override this to provide a different administrator's details to the database admin user.

Overrides:
getSysAdminEmail in class ConfigServlet
Returns:
the System Administrators email address.

handleException

protected void handleException(Melati melati,
                               Exception exception)
                        throws Exception
Default method to handle an exception without a template engine.

Parameters:
melati - the Melati
exception - the exception to handle
Throws:
Exception

_handleException

protected final void _handleException(Melati melati,
                                      Exception exception)
                               throws Exception
Throws:
Exception

poemContext

protected PoemContext poemContext(Melati melati)
                           throws PathInfoException
Overrides:
poemContext in class ConfigServlet
Throws:
PathInfoException

poemContextWithLDB

protected PoemContext poemContextWithLDB(Melati melati,
                                         String logicalDatabase)
                                  throws PathInfoException
Throws:
PathInfoException

doPoemRequest

protected abstract void doPoemRequest(Melati melati)
                               throws Exception
Override this method to build up your own output.

Parameters:
melati -
Throws:
Exception


Copyright © 2000-2010 PanEris. All Rights Reserved.