Do i have to define action method when redirecting from bean method ?

Splash Forums PrettyFaces Users Do i have to define action method when redirecting from bean method ?

Tagged: 

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

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

    mika
    Participant

    i have a UserBean with mapping like:

    @URLMappings(mappings = {
    @URLMapping(id = "viewUsers", pattern = "/viewUsers", viewId = "/faces/viewUsers.xhtml"),
    @URLMapping(id = "addUser", pattern = "/addUser", viewId = "/faces/addUser.xhtml"),
    @URLMapping(id = "editUser", pattern = "/editUser", viewId = "/faces/addUser.xhtml") })

    and a method to addUser like:

    public String addUser()  {

    // some code here
    return "pretty:viewUsers";
    }

    well everything works fine, but the documentation here

    http://ocpsoft.com/docs/prettyfaces/3.3.0/en-US/html_single/#navigation.actions

    says that i should define action method, is it necessary ?

    another thing is that what’s the corresponding to the action tag in @URLMapping annotation, i couldn’t find it.

    i am using JSF 2.1 BTW.

    please advise.

    #21591

    No, you don’t have to use an URL action! It’s completely optional.

    If you want to use URL actions, just add an @URLAction annotation to your method. See the documentation for details:

    http://ocpsoft.com/docs/prettyfaces/3.3.0/en-US/html_single/#config.annotations.action

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

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

Comments are closed.