Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8743381
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 13, 20262026-06-13T11:39:57+00:00 2026-06-13T11:39:57+00:00

I am writing an application using Primefaces 3.4.1, Jboss AS 7.1 and MyFaces CODI.

  • 0

I am writing an application using Primefaces 3.4.1, Jboss AS 7.1 and MyFaces CODI. The problem that I got is that I am using conversation scope provided by CODI and I need a way to deal with the browser back button once the conversation ends.

More precisely- when the conversation ends and the user is on a different page (think about it like a wizard finishing and making a commit to database) if the back button is pressed I recieve the following exception:

javax.ejb.EJBTransactionRolledbackException

Ideally, since the conversation is finished I would like this to redirect back to some other page (menu, dashboard).

Can this be done with JSF 2.0 navigation rules?

EDIT:

I have created a navigation rule like this:

<navigation-rule>
    <from-view-id>/page1.xhtml</from-view-id>
        <navigation-case>
            <from-outcome>outcome1</from-outcome>
            <to-view-id>/page2.xhtml</to-view-id>
            <redirect/>
        </navigation-case>
        <navigation-case>
            <from-outcome>*</from-outcome>
            <to-view-id>/dashboard.xhtml</to-view-id>
            <redirect/>
        </navigation-case>
</navigation-rule>

Hoping that this will make the redirection to dashboard.xhtml if we press back button. I assumed that there is a different action fired in the back end when you press it. Clearly I assumed wrong. Is it any way one could catch whatever is sent by the bakc button using these cases? Possibly with tag?

UPDATE 1:

Apparently the back button from the browser will not trigger the JSF navigation case. Is it clear what it will trigger? I implemented the following filter: https://stackoverflow.com/a/10305799/1611957 What wil it trigger now? Does that make the job of catching it easier?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-13T11:39:58+00:00Added an answer on June 13, 2026 at 11:39 am

    I have finally managed to resolve the issue and it may be helpful for others:

    The first thing to do is to make sure that you are not caching pages. You can do it with the filter explained here:

    https://stackoverflow.com/a/10305799/1611957

    After that you will know that the page is going to be rendered, so you need to do a check before rendering if your conversation beans are instantiated correctly. How to do such a check is explained here:

    https://stackoverflow.com/a/7294707/1611957

    The code that I used is similar to the code posted by BalusC in this question:

    <f:metadata>
        <f:event type="preRenderView" listener="#{authenticator.check}" />
    </f:metadata>
    

    With the java code:

    public void check() {
        if (someCondition) {
            FacesContext facesContext = FacesContext.getCurrentInstance();
            NavigationHandler navigationHandler =
                facesContext.getApplication().getNavigationHandler();
            navigationHandler.handleNavigation(facesContext, null, "outcome");
        }
    }
    

    With that you will dispatch the JSF navigation rule for the “outcome”

    <navigation-rule>
        <from-view-id>*</from-view-id>
        <navigation-case>
            <from-outcome>outcome</from-outcome>
            <to-view-id>/defaultPage.xhtml</to-view-id>
            <redirect/>
        </navigation-case>
    </navigation-rule>
    

    And this is how you can gracefuly handle back button with JSF2.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm writing an application using WPF, and I need to make something that looks
I'm writing an application using WPF, and I need to make something that looks
I am writing a JSF 2.0 Mojarra application using Primefaces 3.3.1 on Tomcat 6.
I am writing an application using Cairo in C that does the following: Load
I'm currently writing an application using Vala that requires me to send data over
I have problem concerning python packages and testing. I'm writing an application using wx
I am writing an application using Symfony. I have some reusable components that I
I'm writing an application using Seam 2.2.x which will be deployed on JBoss 5.1.
I'm writing web application with using Spring, Velocity and Tomcat as container. My problem
i am writing a web application with jsf 2.0 and using primefaces framework. i

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.