com.timeindexing.servlet
Class TimeindexingContextServlet

java.lang.Object
  extended by javax.servlet.GenericServlet
      extended by javax.servlet.http.HttpServlet
          extended by com.timeindexing.servlet.TimeindexingContextServlet
All Implemented Interfaces:
java.io.Serializable, javax.servlet.Servlet, javax.servlet.ServletConfig
Direct Known Subclasses:
NewSelectServlet

public abstract class TimeindexingContextServlet
extends javax.servlet.http.HttpServlet

A base class for all Timeindexing Servlets. It deals with getting the properties files open and setting things up.

If an error occurs when checking the servlet setup or in the arguments are incorrect the response goes through various jsp files. The following values are currently defined in the errorpages.properties file held by the servlet context in the /WEB-INF/ directory. The values are shown here with their default values.

param-nameparam-value
norepositorypropertiespage/error/no_repository_properties.jsp
cantloadrepositorypropertiespage/error/cant_load_repository_properties.jsp
badrepositorypropertiespage/error/bad_repository_properties.jsp
baddefaultrepositorypage/error/bad_default_repository.jsp
noerrorpagepropertiespage/error/no_errorpage_properties.jsp
cantloaderrorpagepropertiespage/error/cant_load_errorpage_properties.jsp
norepositorypage/error/no_repository.jsp
noindexspecifiedpage/error/no_index.jsp
nosecuritycodepage/error/no_code.jsp
badsecuritycodepage/error/bad_code.jsp
selectexceptionpage/error/select_exception.jsp

If an excpetion occurs, the exception is placed in the request attribute "exception".
The response is presented through the selectexceptionpage.

See Also:
Serialized Form

Constructor Summary
TimeindexingContextServlet()
           
 
Method Summary
protected  void checkErrorPages()
          Make sure the names of the error pages are set up with soem default values, if any of them are set to null.
protected  boolean empty(java.lang.String name)
          Is a value empty.
 void init(javax.servlet.ServletConfig config)
          Initialize Timeindexing Servlets.
protected  void initError(javax.servlet.http.HttpServletRequest request, javax.servlet.http.HttpServletResponse response)
          This is called if there is an error during init.
protected  boolean isBrowser(javax.servlet.http.HttpServletRequest request)
          Is the client a browser.
 
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, log, log
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

TimeindexingContextServlet

public TimeindexingContextServlet()
Method Detail

init

public void init(javax.servlet.ServletConfig config)
          throws javax.servlet.ServletException
Initialize Timeindexing Servlets. If there is a problem, then status is set to an error value, rather than throwing an Exception. This allows subclasses more control to get information to the end-user. Consequently, all subclasses need to check that status == GOOD, before continuing.

Specified by:
init in interface javax.servlet.Servlet
Overrides:
init in class javax.servlet.GenericServlet
Throws:
javax.servlet.ServletException

initError

protected void initError(javax.servlet.http.HttpServletRequest request,
                         javax.servlet.http.HttpServletResponse response)
                  throws java.io.IOException
This is called if there is an error during init.

Throws:
java.io.IOException

empty

protected boolean empty(java.lang.String name)
Is a value empty.


isBrowser

protected boolean isBrowser(javax.servlet.http.HttpServletRequest request)
Is the client a browser.


checkErrorPages

protected void checkErrorPages()
Make sure the names of the error pages are set up with soem default values, if any of them are set to null.



Timeindexing 2008