Re: Beginner needs help with basic prettyfaces concepts

Splash Forums PrettyFaces Users Beginner needs help with basic prettyfaces concepts Re: Beginner needs help with basic prettyfaces concepts

#20415

You could try to build such an regex, but I personally would prefer a rewrite rule that redirects to a default language. In this case there would be always a correct language set for the view you are rendering and you won’t need to add special “language is null” handling. Just my two cents! :-)

Regarding two mappings on one class: Unfortunately this is currently not possible due to limitations of Java annotations. But I already thought about adding a @URLMappings annotation for the next version that could be used to encapsulate multiple @URLMapping annotations. Just like JPA’s @JoinColumns annotation:

http://download.oracle.com/javaee/6/api/javax/persistence/JoinColumns.html

In fact the use of this annotation would look like this:

@URLMappings({
@URLMapping(id="mapping1", pattern="/pattern1", viewId="/view1.jsf"),
@URLMapping(id="mapping2", pattern="/pattern2", viewId="/view2.jsf")
})
public class MyBean {
...
}

But in this case @URLQueryParam and @URLAction annotations in the class cannot be assigned easily to the “mapping of the class” as there are multiple ones. I’m unsure how to handle this situation. Perhaps the user should be forced to use the mappingId attribute of the annotations to refer to a specific mapping in this case.