Pergunta

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...

Foi útil?

Solução

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.

Licenciado em: CC-BY-SA com atribuição
Não afiliado a StackOverflow
scroll top