private void resolveFileUploadResumeUrl(FacesContext facesContext) {
        Object request = facesContext.getExternalContext().getRequest();
        if (request instanceof HttpServletRequest) {
            ServletContext servletContext = ((HttpServletRequest) request).getServletContext();
            if (servletContext == null) {
                return;
            }
            Map<String, ? extends ServletRegistration> servletRegistrations = servletContext.getServletRegistrations();
            if (servletRegistrations == null || servletRegistrations.isEmpty()) {
                return;
            }

            fileUploadResumeUrl = servletRegistrations.values().stream()
                    .filter(s -> FileUploadChunksServlet.class.getName().equals(s.getClassName()))
                    .findFirst()
                    .map(ServletRegistration::getMappings)
                    .map(Collection::stream)
                    .flatMap(Stream::findFirst)
                    .map(s -> facesContext.getExternalContext().getApplicationContextPath() + s)
                    .orElse(null);
        }
    }
A {@link PrimeApplicationContext} is a contextual store for the current application.

It can be accessed via:
<blockquote>
PrimeApplicationContext.getCurrentInstance(context)
</blockquote>
primefaces/src/main/java/org/primefaces/context/PrimeApplicationContext.java