org.ops4j.pax.web.extender.samples.whiteboard.internal
Class ExceptionServlet

java.lang.Object
  extended by javax.servlet.GenericServlet
      extended by javax.servlet.http.HttpServlet
          extended by org.ops4j.pax.web.extender.samples.whiteboard.internal.ExceptionServlet
All Implemented Interfaces:
java.io.Serializable, javax.servlet.Servlet, javax.servlet.ServletConfig

public class ExceptionServlet
extends javax.servlet.http.HttpServlet

Servlet that either throws and exception if errorException request parameter is set and is a correct FQN of Throwable subtype. or sends an error if errorCode request parameter is provided. Used to test error page registration. errorCode takes precedence or errorException. If neither is provided or errorCode is not valid http error code or errorException is not correct will throw an IllegalArgumentException. errorCode must in in 400 or 500 range to be considered valid.

See Also:
Serialized Form

Constructor Summary
ExceptionServlet()
           
 
Method Summary
protected  void service(javax.servlet.http.HttpServletRequest req, javax.servlet.http.HttpServletResponse resp)
           
 
Methods inherited from class javax.servlet.http.HttpServlet
doDelete, doGet, doHead, doOptions, doPost, doPut, doTrace, getLastModified, 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
 

Constructor Detail

ExceptionServlet

public ExceptionServlet()
Method Detail

service

protected void service(javax.servlet.http.HttpServletRequest req,
                       javax.servlet.http.HttpServletResponse resp)
                throws javax.servlet.ServletException,
                       java.io.IOException
Overrides:
service in class javax.servlet.http.HttpServlet
Throws:
javax.servlet.ServletException
java.io.IOException


Copyright © 2006-2011 OPS4J - Open Participation Software for Java. All Rights Reserved.