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 8408489
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 9, 20262026-06-09T23:38:44+00:00 2026-06-09T23:38:44+00:00

I wrote myself a custom NavigationHandler very similar to following one but just using

  • 0

I wrote myself a custom NavigationHandler very similar to following one but just using a stack to save the history:

http://jsfatwork.irian.at/book_de/custom_component.html#!idx:/custom_component.html:fig:backnavigationhandler-code

public class HistoryNavigationHandler extends NavigationHandler
{
    private final NavigationHandler navigationHandler;

    private final Stack<String> outcomes;

    public HistoryNavigationHandler(final NavigationHandler navigationHandler)
    {
        this.navigationHandler = navigationHandler;
        this.outcomes = new Stack<String>();
    }

    @Override
    public void handleNavigation(final FacesContext context, final String fromAction, final String outcome)
    {
        if (outcome != null)
        {
            if (outcome.equals("back"))
            {
                final String lastViewId = this.outcomes.pop();

                final ViewHandler viewHandler = context.getApplication().getViewHandler();
                final UIViewRoot viewRoot = viewHandler.createView(context, lastViewId);
                context.setViewRoot(viewRoot);
                context.renderResponse();

                return;
            }
            else
            {
                this.outcomes.push(context.getViewRoot().getViewId());
            }
        }
        this.navigationHandler.handleNavigation(context, fromAction, outcome);
    }
}

Registering this one in the faces-config.xml:

<navigation-handler>
    package.HistoryNavigationHandler
</navigation-handler>

Results in following log warning and a message where a previously working link was present:

Warning: jsf.outcome.target.invalid.navigationhandler.type

Something like: this link is disabled because a navigation case could not be matched

What is the problem?

  • 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-09T23:38:45+00:00Added an answer on June 9, 2026 at 11:38 pm

    Since JSF 2, the NavigationHandler has been replaced by ConfigurableNavigationHandler. All JSF 2 specific tags/components like <h:link> and so on are relying on it. The NavigationHandler is kept for backwards compatibility.

    Here’s a kickoff example how to properly extend ConfigurableNavigationHandler:

    public class HistoryNavigationHandler extends ConfigurableNavigationHandler {
    
        private NavigationHandler wrapped;
    
        public HistoryNavigationHandler(NavigationHandler wrapped) {
            this.wrapped = wrapped;
        }
    
        @Override
        public void handleNavigation(FacesContext context, String from, String outcome) {
    
            // TODO: Do your job here. 
    
            wrapped.handleNavigation(context, from, outcome);        
        }
    
        @Override
        public NavigationCase getNavigationCase(FacesContext context, String fromAction, String outcome) {
            return (wrapped instanceof ConfigurableNavigationHandler)
                ? ((ConfigurableNavigationHandler) wrapped).getNavigationCase(context, fromAction, outcome)
                : null;
        }
    
        @Override
        public Map<String, Set<NavigationCase>> getNavigationCases() {
            return (wrapped instanceof ConfigurableNavigationHandler)
                ? ((ConfigurableNavigationHandler) wrapped).getNavigationCases()
                : null;
        }
    
    }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I wrote myself a custom matcher, which itself works fine. But the failure_message_for_should doesn't
I just wrote some code. It has my own custom made class. In that
I have a custom database class that I wrote myself, and I also have
I'm trying to add a IsImage property that I wrote myself to the HttpPostedFile
Sure I could write this myself, but before I go reinventing the wheel is
I find myself very frequently wanting to write reusable strings with parameter placeholders in
I want to write a simple web framework myself using WSGI, Python. I am
I've been trying myself, and searching online, to write this regular expression but without
I'm looking at porting a custom-written PHP CMS into Django. One of the features
I'm trying to practice myself with custom class loaders, and I've some questions. Is

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.