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 6 years, 9 months ago.

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

    b0rreg0
    Participant

    HI,

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

    for example:

    @Named

    @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?

    #20471

    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:

    http://ocpsoft.com/support/topic/beginner-needs-help-with-basic-prettyfaces-concepts#post-629

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

    #20472

    The issue tracker can be found here:

    http://code.google.com/p/prettyfaces/issues/list

    :)

    #20473

    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! :-)

    Christian

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

You must be logged in to reply to this topic.

Comments are closed.