문제

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