com.atlassian.core.servlet
Class AbstractNoOpServlet

java.lang.Object
  extended by javax.servlet.GenericServlet
      extended by javax.servlet.http.HttpServlet
          extended by com.atlassian.core.servlet.AbstractNoOpServlet
All Implemented Interfaces:
java.io.Serializable, javax.servlet.Servlet, javax.servlet.ServletConfig

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

NoOpServlet is a dummy servlet used only to provide a servlet mapping for url patterns that dont have any. This is necessary as some application servers like WebSphere 6.1.0.5 returns a 404 if there are no mapped servlet before applying filters to the request which could potentially change the URL mapped to a valid servlet. For example, the URLRewriter filter does this. Hence this dummy servlet should never handle any requests.

If this servlet receives a request, it will simply log all relevant information from the request that may be of help in determining why the request was received, as this would not be the desired result.

See Also:
Serialized Form

Constructor Summary
AbstractNoOpServlet()
           
 
Method Summary
protected abstract  java.lang.String getUserName(javax.servlet.http.HttpServletRequest request)
          get the current username from the request
 void service(javax.servlet.ServletRequest servletRequest, javax.servlet.ServletResponse servletResponse)
           
 
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

AbstractNoOpServlet

public AbstractNoOpServlet()
Method Detail

service

public void service(javax.servlet.ServletRequest servletRequest,
                    javax.servlet.ServletResponse servletResponse)
             throws javax.servlet.ServletException,
                    java.io.IOException
Specified by:
service in interface javax.servlet.Servlet
Overrides:
service in class javax.servlet.http.HttpServlet
Throws:
javax.servlet.ServletException
java.io.IOException

getUserName

protected abstract java.lang.String getUserName(javax.servlet.http.HttpServletRequest request)
get the current username from the request

Parameters:
request - to retrieve the usernaem from
Returns:
current username


Copyright © 2009 Atlassian Pty Ltd. All Rights Reserved.