com.protomatter.pas.servlet
Class PASServlet
java.lang.Object
|
+--javax.servlet.GenericServlet
|
+--javax.servlet.http.HttpServlet
|
+--com.protomatter.pas.servlet.PASServlet
- All Implemented Interfaces:
- java.io.Serializable, javax.servlet.Servlet, javax.servlet.ServletConfig
- public abstract class PASServlet
- extends javax.servlet.http.HttpServlet
A useful baseclass for servlets that work with PAS. Provides
some common functionality that's useful in servlets.
- See Also:
- Serialized Form
Constructor Summary |
PASServlet()
Default constructor. |
Method Summary |
protected boolean |
close(java.sql.Connection c)
Close the given JDBC connection. |
protected boolean |
close(java.sql.ResultSet r)
Close the given JDBC resultset. |
protected boolean |
close(java.sql.Statement s)
Close the given JDBC statement. |
protected java.lang.String |
formatException(java.lang.Throwable t)
Format an exteption. |
protected java.sql.Connection |
getConnection(java.lang.String poolname)
Return a connection from the given JDBC connection pool. |
protected javax.naming.Context |
getInitialContext()
Get a reference to a JNDI context attached to the PAS JNDI tree. |
Methods inherited from class javax.servlet.http.HttpServlet |
doDelete, doGet, doHead, doOptions, doPost, doPut, doTrace, getLastModified, service, service |
Methods inherited from class javax.servlet.GenericServlet |
destroy, getInitParameter, getInitParameterNames, getServletConfig, getServletContext, getServletInfo, getServletName, init, init, log, log |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
PASServlet
public PASServlet()
- Default constructor.
getInitialContext
protected javax.naming.Context getInitialContext()
throws javax.naming.NamingException
- Get a reference to a JNDI context attached to the PAS JNDI tree.
close
protected boolean close(java.sql.Connection c)
- Close the given JDBC connection.
- See Also:
DatabaseUtil
close
protected boolean close(java.sql.Statement s)
- Close the given JDBC statement.
- See Also:
DatabaseUtil
close
protected boolean close(java.sql.ResultSet r)
- Close the given JDBC resultset.
- See Also:
DatabaseUtil
getConnection
protected java.sql.Connection getConnection(java.lang.String poolname)
throws java.sql.SQLException
- Return a connection from the given JDBC connection pool.
The pool must have already been registered.
- See Also:
JdbcConnectionPoolDriver
formatException
protected java.lang.String formatException(java.lang.Throwable t)
- Format an exteption. Creates an HTML table with two rows: the
top row has the output of toString() from the exception,
and the bottom row has the stacktrace.