variable error page for onError within pattern. possible?

Splash Forums PrettyFaces Users variable error page for onError within pattern. possible?

This topic contains 3 replies, has 2 voices, and was last updated by  Mulder 5 years, 10 months ago.

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

    Mulder
    Participant

    Hi, we have something like this:

    <pattern value="/#{group.name}/home/">

    <validate index="0" validator="#{groupService.validate}" onError="pretty:error" />

    </pattern>

    which was sufficient until we decided to activate groups before user can log in to them. So the group validator now also tests if a group is active (in addition if it exists) and we want to serve a different page. Is it possible to distinguisgh between thrown exceptions and then redirect to different pages? i.e.

    onError="#{exception eq GroupInactiveException ? 'pretty:inactive' : 'pretty:error']"

    #21764

    I’m not sure if this works, but you could try a simple method expression:

    onError="#{bean.method}"

    It may or may not, i’m not sure atm and can’t look right now

    #21765

    Mulder
    Participant

    would I have access to the exception within bean.method to be able to select different targets?

    #21766

    Mulder
    Participant

    for now, i added the exception to the externalcontext and unwrapped it again in “bean.method”

    it would be cool though if pretty faces could handle different exception targets.

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

You must be logged in to reply to this topic.

Comments are closed.