config-prettyfaces/src/main/java/com/ocpsoft/pretty/faces/util/FacesNavigationURLCanonicalizer.java
public static String normalizeRequestURI(final String servletPath, final String requestPathInfo, final String viewId)
   {
      
      // We must not process empty viewIds
      if (viewId == null)
      {
         return null;
      }

      /*
       * code from com.sun.faces.util.Util#getMappingForRequest(String servletPath, String pathInfo)
       * and  com.sun.faces.application.view.MultiViewHandler#normalizeRequestURI(String uri, String mapping)
       */
      if (servletPath != null)
      {
         if ((requestPathInfo != null || servletPath.indexOf('.') < 0) && viewId.startsWith(servletPath + '/'))
         {
            return viewId.substring(servletPath.length());
         }
      }

      return viewId;
   }
public static String normalizeRequestURI(final String servletPath, final String requestPathInfo, final String viewId)
   {
      
      // We must not process empty viewIds
      if (viewId == null)
      {
         return null;
      }

      /*
       * code from com.sun.faces.util.Util#getMappingForRequest(String servletPath, String pathInfo)
       * and  com.sun.faces.application.view.MultiViewHandler#normalizeRequestURI(String uri, String mapping)
       */
      if (servletPath != null)
      {
         if ((requestPathInfo != null || servletPath.indexOf('.') < 0) && viewId.startsWith(servletPath + '/'))
         {
            return viewId.substring(servletPath.length());
         }
      }

      return viewId;
   }
public static String normalizeRequestURI ( final String servletPath , final String requestPathInfo , final String viewId ) { // We must not process empty viewIds if ( viewId == null ) { return null ; } /*
       * code from com.sun.faces.util.Util#getMappingForRequest(String servletPath, String pathInfo)
       * and  com.sun.faces.application.view.MultiViewHandler#normalizeRequestURI(String uri, String mapping)
       */ if ( servletPath != null ) { if ( ( requestPathInfo != null || servletPath . indexOf ( ' ' ) < 0 ) && viewId . startsWith ( servletPath + ' ' ) ) { return viewId . substring ( servletPath . length ( ) ) ; } } return viewId ; }
Prune the url-pattern from the <code>viewId</code> if prefix mapped
FacesServlet, otherwise return the original URI.

@param servletPath
the servlet path
@param requestPathInfo
the path info
@param viewId
the view id
@return the URI without additional FacesServlet mappings
@see javax.servlet.http.HttpServletRequest#getServletPath()
@see javax.servlet.http.HttpServletRequest#getPathInfo()
Prune the url - pattern from the <code > viewId< / code > if prefix mapped FacesServlet otherwise return the original URI .