Вопрос

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

Это было полезно?

Решение

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.

Лицензировано под: CC-BY-SA с атрибуция
Не связан с StackOverflow
scroll top