質問

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