Question

I need to test some strings against the existing mapping ids, I would like to get all the mapping ids before runtime (statically), is this possible ?

In theory PrettyFaces would only have to parse the pretty-config.xml in order to allow this, but currently calling PrettyContext.getCurrentInstance().getConfig().getMappings() will fail as the faces context is not available...

Was it helpful?

Solution

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.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top