Functionality in annotation configuration

Splash Forums Rewrite Users Functionality in annotation configuration

This topic contains 1 reply, has 2 voices, and was last updated by  Christian Kaltepoth 2 years ago.

Viewing 2 posts - 1 through 2 (of 2 total)
  • Author
    Posts
  • #26342

    welyab
    Participant

    Rewrite offers any way to mapping multiple paths to single jsf page using annotations?
    Something like this:

    @Joins({
        @Join(path="/url-one", to="page.jsf"),
        @Join(path="/url-two", to="page.jsf") // ...
    });
    @Named
    @RequestScoped
    public class PageBean {
     //...
    }

    **offtopic
    When is necessary use Direction.isOutbound() ??
    There is some example ?
    I was thinking that use when jsf backbean method returns, but Prettyfaces migration guide shows that jsf bean use the Navigate class, from the JSF rewrite integration module.

    • This topic was modified 2 years ago by  welyab.
    #26345

    Hey,

    no, there is currently no way to specify multiple joins on a single class using annotations. Providing something like this would make many things much more complicated. For example, to which join would a @Parameter annotation refer? And to be honest, I think it is bad practice to have multiple joins on a single class as this typically shows that your bean violates the single responsibility principle.

    Regarding inbound vs outbound. These are two different rewrite types. Inbound rewriting modifies the URL which is sent by the client to request a resource on the server. Outbound rewriting modifies URLs that are written to the HTML page by the server. A join is essentially an inbound AND and outbound rule.

    You can have a look at slides 18 – 20 of this presentation for a visualization:

    The Navigate class is just a a convenience class which helps to build standard JSF outcome strings. You are not forced to use it, but it makes it a little bit easier.

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

You must be logged in to reply to this topic.

Comments are closed.