In this case, you should use: PrettyContext.getCurrentInstance(final HttpServletRequest request)
This will give you access to the configuration without using .getCurrentInstance()
- which is only one way of obtaining the PrettyContext, and happens to require an active FacesContext.