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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 27, 20262026-05-27T12:32:06+00:00 2026-05-27T12:32:06+00:00

We are using JSF2 and using Navigation Handler to control the navigation between public

  • 0

We are using JSF2 and using Navigation Handler to control the navigation between public and secured pages of our web application.

The logic has become so complicated as we need to check for which page is secure and which page is public.

Is there any framework or better way to handle Navigation Handler…

  • 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-05-27T12:32:07+00:00Added an answer on May 27, 2026 at 12:32 pm

    Normally you put the secured pages in a common URL path, such as /app/*, /secured/*, /private/*, etc. This way you can use a single entry point to control the access. If you’re using container managed security, it’s then a matter of specifying the proper URL pattern:

    <security-constraint>
        <web-resource-collection>
            <web-resource-name>Restricted pages</web-resource-name>
            <url-pattern>/secured/*</url-pattern>
        </web-resource-collection>
        <auth-constraint>
            <role-name>*</role-name>
        </auth-constraint>
    </security-constraint>
    

    If you are however using homegrown security, then you need to implement a Filter for that instead:

    @WebFilter("/secured/*")
    public class AuthorizationFilter implements Filter {
        // ...
    }
    

    or when you’re still not on Servlet 3.0 yet, then register it as follows instead of using @WebFilter:

    <filter>
        <filter-name>authorizationFilter</filter-name>
        <filter-class>com.example.AuthorizationFilter</filter-class>
    </filter>
    <filter-mapping>
        <filter-name>authorizationFilter</filter-name>
        <url-pattern>/secured/*</url-pattern>
    </filter-mapping>
    

    Inside the doFilter() method you need to write code which checks if the user is logged in or not and then continues the chain or redirects the response to the login page (which is by itself of course not covered by the same URL pattern).

    See also:

    • Is there any easy way to preprocess and redirect GET requests?
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Im working on a web application using JSF2 . I want to pass parameters
I am using JSF2.0 with Richfaces 4.0.0.Final for a web application. I have a
I developed a simple demo web application using JSF2.0 and hibernate. This webapp use
We are using JSF2.0 for our application ,we are using QA Load to load
Using JDeveloper , I started developing a set of web pages for a project
I am using JSF 2.0 and attempting to pass values between different pages in
I have a web project using jsf2 implementing a gaming web site on tomcat7.
Our application is JSF2 based and we are desiging a exception handling for that.
I'm doing a Web application using Spring 3.1.0.RELEASE, JSF 2.x, JPA 2 with Hibernate
I am using JSF2.0 and facelets. How to perform sorting, filtering and page navigation

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.