echopoint.servlet
Class EchoPointServer

java.lang.Object
  extended by javax.servlet.GenericServlet
      extended by javax.servlet.http.HttpServlet
          extended by nextapp.echoservlet.EchoServer
              extended by echopoint.servlet.EchoPointServer
All Implemented Interfaces:
java.io.Serializable, javax.servlet.Servlet, javax.servlet.ServletConfig

public abstract class EchoPointServer
extends EchoServer

EchoPointServer is a derivation of EchoServer that provides some more services than the standard one.

* A full exception dump facility to help with diagnosis of application problems.

* Optional compression of textual browser interactions.

See Also:
Serialized Form

Nested Class Summary
 
Nested classes/interfaces inherited from class nextapp.echoservlet.EchoServer
EchoServer.MultipartRequestWrapper
 
Field Summary
 
Fields inherited from class nextapp.echoservlet.EchoServer
CHARACTER_ENCODING_ISO_8859_1, CHARACTER_ENCODING_ISO_8859_2, CHARACTER_ENCODING_ISO_8859_3, CHARACTER_ENCODING_ISO_8859_4, CHARACTER_ENCODING_ISO_8859_5, CHARACTER_ENCODING_US_ASCII, CHARACTER_ENCODING_UTF_8, ID_STRING, SERVICE_BLANK_DOCUMENT, SERVICE_CLIENT_ERROR_SCRIPT, SERVICE_COLLECTIONS_SCRIPT, SERVICE_INITIALIZER, SERVICE_SAFE_INVOKE_DEFAULT, SERVICE_SAFE_INVOKE_EXCEPTION_SUPPORT, SERVICE_SESSION_EXPIRED
 
Constructor Summary
EchoPointServer()
           
 
Method Summary
protected  void describeThrowable(InstancePeer instancePeer, javax.servlet.http.HttpServletRequest request, javax.servlet.http.HttpServletResponse response, java.lang.Throwable throwable)
          This method is called to descibe an error condition.
 java.lang.String getApplicationTitle()
          Returns the name of this web application for display purposes
 boolean isCompressionUsed()
          Returns true if compression should be used to compress replies back client browsers that can accept compressed content.
protected  void process(javax.servlet.http.HttpServletRequest request, javax.servlet.http.HttpServletResponse response)
          Handles an HTTP request to the EchoServer.
protected  void processException(Connection conn, javax.servlet.http.HttpServletRequest request, javax.servlet.http.HttpServletResponse response, java.lang.Exception ex)
          This method provides a more helpful and detailed explanation of the exception has occurred.
protected  void processThrowable(Connection conn, javax.servlet.http.HttpServletRequest request, javax.servlet.http.HttpServletResponse response, java.lang.Throwable throwable)
          This method provides a more helpful and detailed explanation of the exception has occurred.
 void setCompressionUsed(boolean b)
          Controls whether compression will be used on replies to client browsers that can accept compressed content.
 
Methods inherited from class nextapp.echoservlet.EchoServer
addGlobalService, doGet, doPost, getActiveRequestThreads, getApplicationProperties, getDefaultLocale, getLastModified, getMultipartRequestWrapper, getSessionExpirationUri, init, isCompressableRequest, loadPeerBindings, newInstance, setMultipartRequestWrapper
 
Methods inherited from class javax.servlet.http.HttpServlet
doDelete, doHead, doOptions, doPut, doTrace, 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

EchoPointServer

public EchoPointServer()
Method Detail

process

protected void process(javax.servlet.http.HttpServletRequest request,
                       javax.servlet.http.HttpServletResponse response)
                throws java.io.IOException,
                       javax.servlet.ServletException
Description copied from class: EchoServer
Handles an HTTP request to the EchoServer. This method will create a Connection to wrap the request and response objects provided by the servlet container and invoke Connection's process() method to handle it. If the request is encoded as multipart/form-data, the MultipartRequestWrapper will be used.

Overrides:
process in class EchoServer
Parameters:
request - The HTTPServletRequest object provided by the servlet container.
response - The HTTPServletResponse object provided by the servlet container.
Throws:
java.io.IOException
javax.servlet.ServletException
See Also:
EchoServer.process(javax.servlet.http.HttpServletRequest, javax.servlet.http.HttpServletResponse)

processException

protected void processException(Connection conn,
                                javax.servlet.http.HttpServletRequest request,
                                javax.servlet.http.HttpServletResponse response,
                                java.lang.Exception ex)
                         throws java.io.IOException,
                                javax.servlet.ServletException
This method provides a more helpful and detailed explanation of the exception has occurred. This method ends up being a pass through call to processThrowable().

Overrides:
processException in class EchoServer
request - The HttpServletRequest in use during failure.
response - The HttpServletResponse in use during failure.
ex - The Exception that occurred.
Throws:
java.io.IOException
javax.servlet.ServletException
See Also:
nextapp.echoservlet.EchoServer#processException(nextapp.echoservlet.InstancePeer, javax.servlet.http.HttpServletRequest, javax.servlet.http.HttpServletResponse, java.lang.Exception), EchoPointServer#processThrowable(InstancePeer, HttpServletRequest, HttpServletResponse, Throwable)

processThrowable

protected void processThrowable(Connection conn,
                                javax.servlet.http.HttpServletRequest request,
                                javax.servlet.http.HttpServletResponse response,
                                java.lang.Throwable throwable)
                         throws java.io.IOException,
                                javax.servlet.ServletException
This method provides a more helpful and detailed explanation of the exception has occurred. If you want to customise what happens in this method, you should overrride the describeThrowable method not this one, as this one does important setup.

This method is needed so that Throwable objects can be caught as well as Exceptions.

Throws:
java.io.IOException
javax.servlet.ServletException
See Also:
nextapp.echoservlet.EchoServer#processException(nextapp.echoservlet.InstancePeer, javax.servlet.http.HttpServletRequest, javax.servlet.http.HttpServletResponse, java.lang.Exception)

describeThrowable

protected void describeThrowable(InstancePeer instancePeer,
                                 javax.servlet.http.HttpServletRequest request,
                                 javax.servlet.http.HttpServletResponse response,
                                 java.lang.Throwable throwable)
                          throws java.io.IOException
This method is called to descibe an error condition. It is called indirectly from the processException() / processThrowable() method. You should override this method if you want to customise what is displayed to the user, not the processException() / processThrowable() method.

Parameters:
instancePeer - - the instancePeer in play
request - - the HttpServletRequest in play
response - - the HttpServletResponse in play
throwable - - the Throwable to describe
Throws:
java.io.IOException
See Also:
EchoServer#processException(InstancePeer, HttpServletRequest, HttpServletResponse, Exception), EchoPointServer#processException(InstancePeer, HttpServletRequest, HttpServletResponse, Exception)

getApplicationTitle

public java.lang.String getApplicationTitle()
Returns the name of this web application for display purposes

Returns:
the name of this web application for display purposes

isCompressionUsed

public boolean isCompressionUsed()
Returns true if compression should be used to compress replies back client browsers that can accept compressed content.

Returns:
true if compression should be used to compress replies back client browsers that can accept compressed content.
See Also:
CompressingHttpServletResponse, CompressingHttpServletResponse.getInstance(HttpServletRequest, HttpServletResponse)

setCompressionUsed

public void setCompressionUsed(boolean b)
Controls whether compression will be used on replies to client browsers that can accept compressed content.

Parameters:
b - - true or false
See Also:
CompressingHttpServletResponse, CompressingHttpServletResponse.getInstance(HttpServletRequest, HttpServletResponse)