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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 5, 20262026-06-05T15:39:11+00:00 2026-06-05T15:39:11+00:00

Is there any way in JSF which can be used to find out whether

  • 0

Is there any way in JSF which can be used to find out whether an user reached a page by the Navigation rule of the JSF or user has typed the URL directly to reach that page?

Actully I want to prevent user to go to a page directly by typing the URL for that directly in the Browser, rather I want to restrict the user to use the application navigation bar to go to an page.

  • 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-05T15:39:13+00:00Added an answer on June 5, 2026 at 3:39 pm

    There is a way: check the presence of the referer header (yes, with the misspelling).

    if (externalContext.getRequestHeader("referer") == null) {
        // User has most likely accessed the page by directly typing the URL.
    }
    

    or

    <h:panelGroup rendered="#{empty header['referer']}">
        <!-- User has most likely accessed the page by directly typing the URL. -->
    </h:panelGroup>
    

    This will however fail for users who have neatly used the link in your webpage, but are using some overzealous proxy/firewall/security software which hides the referer header altogether.

    You might want to consider to make the page never directly available to users by placing it in /WEB-INF folder and using it as a conditional include which is executed by a POST request (if necessary with ajax). E.g.

    <h:form>
        <h:commandLink action="#{bean.showPage}" />
    </h:form>
    
    <h:panelGroup rendered="#{bean.showPage}">
        <ui:include src="/WEB-INF/includes/foo.xhtml" />
    </h:panelGroup>
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Is there any way in which I can automatically convert a Custom Class Object
Is there any way I can validate a jsf input text that is readonly
Is there any way I can speed up the development of JSF in Eclipse
Is there any way to get direct URL to a JSF bean action method?
Is there any way I can set a formatter on models that will convert
Is there any way to use Google's API to retrieve a user's current zipcode
Is there any way we can fetch X509 Public Cetrificates using c# from AD
Is there any way of providing a file download from a JSF backing bean
is there any way i can set the color of the text in the
Are there any guarantees about the order in which JSF creates its managed beans?

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.