@Override
    public String getPath() {
        var fullPath = request.getRequestURI();
        // it shouldn't be null, but in case it is, it's better to return empty string
        if (fullPath == null) {
            return Pac4jConstants.EMPTY_STRING;
        }
        // very strange use case
        if (fullPath.startsWith("//")) {
            fullPath = fullPath.substring(1);
        }
        val context = request.getContextPath();
        // this one shouldn't be null either, but in case it is, then let's consider it is empty
        if (context != null) {
            return fullPath.substring(context.length());
        }
        return fullPath;
    }
{@inheritDoc}

This is not implemented using {@link HttpServletRequest#getServletPath()} or
{@link HttpServletRequest#getPathInfo()} because they both have strange behaviours
in different contexts (inside servlets, inside filters, various container implementation, etc)
pac4j-javaee/src/main/java/org/pac4j/jee/context/JEEContext.java