Holger's Java API

## com.antelmann.servlet
Class DBEntryServlet

    java.lang.Object
      javax.servlet.GenericServlet
          javax.servlet.http.HttpServlet
              com.antelmann.servlet.DBEntryServlet

All Implemented Interfaces:
  Serializable, javax.servlet.Servlet, javax.servlet.ServletConfig

    public class DBEntryServlet

extends javax.servlet.http.HttpServlet

a special servlet capable of displaying entries from a database

Since:
  08.04.2009, 13:26:41
Author:
  Holger Antelmann
See Also:
  Serialized Form

Field Summary
`protected EntryClassMapper` `ecm` per default initialized to `EntryClassMapper.STRING_MAPPER`

Constructor Summary
`DBEntryServlet()`

Method Summary
`protected Connection` `createConnection()`
`protected Database<?>` `createDatabase()`
`protected void` `doGet(javax.servlet.http.HttpServletRequest req, javax.servlet.http.HttpServletResponse resp)`
`protected void` `doPost(javax.servlet.http.HttpServletRequest req, javax.servlet.http.HttpServletResponse resp)`
`Database<?>` `getDatabase()`
`void` `init()`
`protected DBReference` `makeReference(javax.servlet.http.HttpServletRequest req)`
`protected void` `showEntry(DBEntry entry, javax.servlet.http.HttpServletRequest req, javax.servlet.http.HttpServletResponse resp)` supports `HtmlSupported`, `Imageable`, `DetailedString` and `Object.toString()`.
`protected void` `wrongInput(javax.servlet.http.HttpServletResponse resp, String msg)`

Methods inherited from class javax.servlet.http.HttpServlet
`doDelete, doHead, doOptions, doPut, doTrace, getLastModified, service, service`

Methods inherited from class javax.servlet.GenericServlet
`destroy, 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`

Field Detail

### ecm

    protected EntryClassMapper ecm

  per default initialized to `EntryClassMapper.STRING_MAPPER`

Constructor Detail

### DBEntryServlet

    public DBEntryServlet()

Method Detail

### init

    public void init()
              throws javax.servlet.ServletException

  Overrides:
    `init` in class `javax.servlet.GenericServlet`
  Throws:
    `javax.servlet.ServletException`

### createDatabase

    protected Database<?> createDatabase()
                                  throws Exception

  Throws:
    `Exception`

### createConnection

    protected Connection createConnection()
                                   throws SQLException,
                                          GeneralSecurityException

  Throws:
    `SQLException`
    `GeneralSecurityException`

### getDatabase

    public Database<?> getDatabase()

### doGet

    protected void doGet(javax.servlet.http.HttpServletRequest req,
                         javax.servlet.http.HttpServletResponse resp)
                  throws javax.servlet.ServletException,
                         IOException

  Overrides:
    `doGet` in class `javax.servlet.http.HttpServlet`
  Throws:
    `javax.servlet.ServletException`
    `IOException`

### doPost

    protected void doPost(javax.servlet.http.HttpServletRequest req,
                          javax.servlet.http.HttpServletResponse resp)
                   throws javax.servlet.ServletException,
                          IOException

  Overrides:
    `doPost` in class `javax.servlet.http.HttpServlet`
  Throws:
    `javax.servlet.ServletException`
    `IOException`

### makeReference

    protected DBReference makeReference(javax.servlet.http.HttpServletRequest req)
                                 throws Exception

  Throws:
    `Exception`

### showEntry

    protected void showEntry(DBEntry entry,
                             javax.servlet.http.HttpServletRequest req,
                             javax.servlet.http.HttpServletResponse resp)
                      throws javax.servlet.ServletException,
                             IOException

  supports `HtmlSupported`, `Imageable`, `DetailedString` and `Object.toString()`. For `Imageable` entries, the parameter values width and height are supported.

  Throws:
    `javax.servlet.ServletException`
    `IOException`

### wrongInput

    protected void wrongInput(javax.servlet.http.HttpServletResponse resp,
                              String msg)
                       throws IOException

  Throws:
    `IOException`

(c) Holger Antelmann since 2001- all rights reserved (contact: info@antelmann.com)
see www.antelmann.com/developer for further details and available downloads