org.apache.camel.component.http.helper
Class UrlRewriteHttpServletRequestAdapter

java.lang.Object
  extended by javax.servlet.ServletRequestWrapper
      extended by javax.servlet.http.HttpServletRequestWrapper
          extended by org.apache.camel.component.http.helper.UrlRewriteHttpServletRequestAdapter
All Implemented Interfaces:
javax.servlet.http.HttpServletRequest, javax.servlet.ServletRequest

public final class UrlRewriteHttpServletRequestAdapter
extends javax.servlet.http.HttpServletRequestWrapper

Special adapter when HttpServletUrlRewrite is in use, and the route started from came-jetty/camel-serlvet.

This adapter ensures that we can control the context-path returned from the HttpServletRequest.getContextPath() method. This allows us to ensure the context-path is based on the endpoint path, as the camel-jetty/camel-servlet server implementation uses the root ("/") context-path for all the servlets/endpoints.


Field Summary
 
Fields inherited from interface javax.servlet.http.HttpServletRequest
BASIC_AUTH, CLIENT_CERT_AUTH, DIGEST_AUTH, FORM_AUTH
 
Constructor Summary
UrlRewriteHttpServletRequestAdapter(javax.servlet.http.HttpServletRequest delegate, String contextPath)
          Creates this adapter
 
Method Summary
 String getContextPath()
           
 
Methods inherited from class javax.servlet.http.HttpServletRequestWrapper
authenticate, getAuthType, getCookies, getDateHeader, getHeader, getHeaderNames, getHeaders, getIntHeader, getMethod, getPart, getParts, getPathInfo, getPathTranslated, getQueryString, getRemoteUser, getRequestedSessionId, getRequestURI, getRequestURL, getServletPath, getSession, getSession, getUserPrincipal, isRequestedSessionIdFromCookie, isRequestedSessionIdFromUrl, isRequestedSessionIdFromURL, isRequestedSessionIdValid, isUserInRole, login, logout
 
Methods inherited from class javax.servlet.ServletRequestWrapper
getAsyncContext, getAttribute, getAttributeNames, getCharacterEncoding, getContentLength, getContentType, getDispatcherType, getInputStream, getLocalAddr, getLocale, getLocales, getLocalName, getLocalPort, getParameter, getParameterMap, getParameterNames, getParameterValues, getProtocol, getReader, getRealPath, getRemoteAddr, getRemoteHost, getRemotePort, getRequest, getRequestDispatcher, getScheme, getServerName, getServerPort, getServletContext, isAsyncStarted, isAsyncSupported, isSecure, isWrapperFor, isWrapperFor, removeAttribute, setAttribute, setCharacterEncoding, setRequest, startAsync, startAsync
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface javax.servlet.ServletRequest
getAsyncContext, getAttribute, getAttributeNames, getCharacterEncoding, getContentLength, getContentType, getDispatcherType, getInputStream, getLocalAddr, getLocale, getLocales, getLocalName, getLocalPort, getParameter, getParameterMap, getParameterNames, getParameterValues, getProtocol, getReader, getRealPath, getRemoteAddr, getRemoteHost, getRemotePort, getRequestDispatcher, getScheme, getServerName, getServerPort, getServletContext, isAsyncStarted, isAsyncSupported, isSecure, removeAttribute, setAttribute, setCharacterEncoding, startAsync, startAsync
 

Constructor Detail

UrlRewriteHttpServletRequestAdapter

public UrlRewriteHttpServletRequestAdapter(javax.servlet.http.HttpServletRequest delegate,
                                           String contextPath)
Creates this adapter

Parameters:
delegate - the real http servlet request to delegate.
contextPath - use to override and return this context-path
Method Detail

getContextPath

public String getContextPath()
Specified by:
getContextPath in interface javax.servlet.http.HttpServletRequest
Overrides:
getContextPath in class javax.servlet.http.HttpServletRequestWrapper


Apache Camel