define multi @URLMapping in one class

Splash Forums PrettyFaces Users define multi @URLMapping in one class

This topic contains 3 replies, has 3 voices, and was last updated by  Christian Kaltepoth 11 years, 1 month ago.

Viewing 4 posts - 1 through 4 (of 4 total)
  • Author
  • #17833



    I’d like to use a lot of @UrlMapping in one class insteaf of define this mapping in xml.

    for example:


    @URLMapping(id = “search1”, pattern = “/admin/search/#{year}”, viewId = “/admin/search.jsf”)

    @URLMapping(id = “search2”, pattern = “/admin/search/#{year}/#{month}”, viewId = “/admin/search.jsf”)

    @URLMapping(id = “search3”, pattern = “/admin/search/#{numbertId}/#{year}/#{month}”, viewId = “/admin/search.jsf”)

    public class SeachBean{


    I tried this but I only can put one annotation @UrlMapping.

    How I can to do it without xml config?


    Placing multiple annotations of the same type on a single class is not supported due to limitations of the Java annotations system. Currently your only way is to use the XML configuration or to split the mappings over multiple classes.

    I thought about adding a @UrlMappings annotation to support something like this but there are some details that have to be considered before doing so. See this post a few weeks ago:

    If you have strong interest in such an feature you could open a ticket for this and post your ideas.


    The issue tracker can be found here:



    Hey b0rreg0,

    I just committed the implementation of the new @URLMappings annotation to the PrettyFaces trunk. If you have still interest in this new feature, you could try the latest snapshot. All kind of feedback is welcome! :-)


Viewing 4 posts - 1 through 4 (of 4 total)

The forum ‘PrettyFaces Users’ is closed to new topics and replies.

Comments are closed.