Rewrite, JSF2 ActionListener navigation

Splash Forums Rewrite Users Rewrite, JSF2 ActionListener navigation

This topic contains 2 replies, has 2 voices, and was last updated by  tohu 1 month, 1 week ago.

Viewing 3 posts - 1 through 3 (of 3 total)
  • Author
  • #27417


    I currently am deploying websphere application with Jsf 2.2.1 and Rewrite 2.0.12, along with the rewrite integration for faces.

    I’m looking at a commandLink something like this:

    <h:commandLink value="Do a thing" actionListener="#{bean.doThat}">
        <f:attribute name="something" value="#{somevalue}"></f:attribute>

    With a matching action listener method in the bean like so

    public void doThat(ActionEvent e) throws IOException
        Object o = e.getComponent().getAttribute().get("something");

    My application configuration has this rule:


    Which all works, that’s great….but..

    Is there a nicer way to do this? I really like how action methods work by returning Navigation objects.

    I’ve tried returning a Navigation object with the actionListener, but that didn’t work. Likewise returning a string “/nextPage”, or even “/directory/subdirectory/nextPage.xhtml” does not work. They all simply act as post backs and “refresh” the page.

    So if there is anyway to make the actionListener navigation a little more like an action navigation, I would be very pleased to find out.


    I agree that this way of navigating isn’t very nice. But why do you use actionListener and not a standard action? As actionListener don’t allow do trigger navigation directly, things are getting dirty. 😉

    You COULD perhaps use the JSF NavigationHandler for navigation. In this case you could even use the Navigate class, but that could may be even more ugly.



    Yes you are right, I think this was a habit picked up from jsf 1.2 and richfaces.

    There is definitely several other means of doing what we want here, so I’ll just change it up.


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

You must be logged in to reply to this topic.

Comments are closed.