String p = contextPath + servletPath;
String p; if (containsContextPath) { p = contextPath + servletPath; } else { p = servletPath; }
    public final String getAbsolutePath(String uri, boolean containsContextPath) {        String contextPath;        if (containsContextPath) {            contextPath = this.contextPath;        } else {            contextPath = "";        }        if (uri == null || uri.length() < 1) {            // Retourne le context path            String p = contextPath + servletPath;            if (LOG.isDebugEnabled()) {                LOG.debug("Returns path='" + p + "' [uri=null]  ('"                        + contextPath + "''" + servletPath + "'.)");            }            return p;        }        if (uri.charAt(0) == '/') {            // URL absolue            String p = normalizePath(contextPath + uri);            if (LOG.isDebugEnabled()) {                LOG                        .debug("Returns path='" + p + "' [uri=absolute]  ('"                                + contextPath + "''" + servletPath + "''" + uri                                + "'.)");            }            return p;        }        // C'est un URI relatif !        if (baseHREF != null) {            if (baseHREF.charAt(0) == '/') {                // base HREF absolue !                String p = normalizePath(baseHREF + uri);                if (LOG.isDebugEnabled()) {                    LOG.debug("Returns path='" + p                            + "' [uri=relative,baseHREF=absolute]  ('"                            + baseHREF + uri + "'.)");                }                return p;            }            // base HREF relatif !            String p = normalizePath(contextPath + servletPath + "/" + baseHREF                    + uri);            if (LOG.isDebugEnabled()) {                LOG.debug("Returns path='" + p                        + "' [uri=relative,baseHREF=relative]  ('"                        + contextPath + "''" + servletPath + "'/'" + baseHREF                        + uri + "'.)");            }            return p;        }        String p = normalizePath(contextPath + servletPath + "/" + uri);        if (LOG.isDebugEnabled()) {            LOG.debug("Returns path='" + p                    + "' [uri=relative,baseHREF=null] ('" + contextPath + "''"                    + servletPath + "'/'" + uri + "'.)");        }        return p;    }