org.omnifaces.facesviews
Class UriExtensionRequestWrapper

java.lang.Object
  extended by javax.servlet.ServletRequestWrapper
      extended by javax.servlet.http.HttpServletRequestWrapper
          extended by org.omnifaces.facesviews.UriExtensionRequestWrapper
All Implemented Interfaces:
javax.servlet.http.HttpServletRequest, javax.servlet.ServletRequest

public class UriExtensionRequestWrapper
extends javax.servlet.http.HttpServletRequestWrapper

This wraps a request to an extensionless JSF view and provides an extension for all methods that reveal the servlet path. Additional the path info is set to null.

This is needed since JSF implementations inspect the request to determine if a prefix (path) or suffix (extension) mapping was used. If the request is neither (in effect, an "exact and extensionless mapping), JSF will get confused and not be able to derive view IDs etc correctly.

Since:
1.4
Author:
Arjan Tijms

Field Summary
 
Fields inherited from interface javax.servlet.http.HttpServletRequest
BASIC_AUTH, CLIENT_CERT_AUTH, DIGEST_AUTH, FORM_AUTH
 
Constructor Summary
UriExtensionRequestWrapper(javax.servlet.http.HttpServletRequest request, java.lang.String extension)
           
 
Method Summary
 java.lang.String getPathInfo()
           
 java.lang.String getRequestURI()
           
 java.lang.StringBuffer getRequestURL()
           
 java.lang.String getServletPath()
           
 
Methods inherited from class javax.servlet.http.HttpServletRequestWrapper
authenticate, getAuthType, getContextPath, getCookies, getDateHeader, getHeader, getHeaderNames, getHeaders, getIntHeader, getMethod, getPart, getParts, getPathTranslated, getQueryString, getRemoteUser, getRequestedSessionId, 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

UriExtensionRequestWrapper

public UriExtensionRequestWrapper(javax.servlet.http.HttpServletRequest request,
                                  java.lang.String extension)
Method Detail

getServletPath

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

getRequestURI

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

getRequestURL

public java.lang.StringBuffer getRequestURL()
Specified by:
getRequestURL in interface javax.servlet.http.HttpServletRequest
Overrides:
getRequestURL in class javax.servlet.http.HttpServletRequestWrapper

getPathInfo

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