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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 2, 20262026-06-02T09:28:50+00:00 2026-06-02T09:28:50+00:00

let me give you an idea about how the system works. I am using

  • 0

let me give you an idea about how the system works.

I am using JAAS login module for login and role management. I can access specific pages depending on the role i have.

I type my url in the address bar, hit enter.

The login page appears and after correct login, it redirects me to the correct page(for now lets call it page1.jsf).

I want to call a server side method on page load.

Can you help me please?

** EDIT **

Assume i have to access page1.jsf which is accessible to role1 only.

In the address bar, i type http://localhost:8080/myapp/page1.jsf

JAAS shows up the login page and after correctly inputting the credentials, i am redirected to page1.jsf

As soon as page1.jsf is requested or on page load, i want to call a server side method from my class to reload page1.jsf

  • 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-02T09:28:51+00:00Added an answer on June 2, 2026 at 9:28 am

    If you are using JSF 2, you can use the above page snippet:

    <html xmlns="http://www.w3.org/1999/xhtml"
      ... >
     <f:view contentType="text/html">
        <f:event type="preRenderView" listener="#{permissionManager.checkRoles}" />
        <f:attribute name="roles" value="ROLE" />
    
      ...
      </f:view>
    </html>
    

    you can add an attribute containing the role and in the PermissionManager.checkRoles() perform redirect to the corret page.

    @Named
    @ApplicationScoped
    class PermissionManager { 
      ...
      public void checkRoles(ComponentSystemEvent event) {
    
           String acl = "" + event.getComponent().getAttributes().get("roles");
           //Check user role
           ...
           //Redirect if required
           try {
    
            ConfigurableNavigationHandler handler = (ConfigurableNavigationHandler) context
                    .getApplication().getNavigationHandler();
            handler.performNavigation("access-denied");
        } catch (Exception e) {
            ...
        }
    
       }
    
    }
    

    Check out this example
    and take a look at this related question

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

Sidebar

Related Questions

Let me give an idea of what I wish to do: I have a
Ok, the question might not be crystal clear. Let me give some details: Let's
Let's consider the following scenario: a function which can generate code colors from white
Could someone please give me some advice/ideas about how to deal with the situations
I am new Rails developer. Right now, I can let user register in my
I know my question is too inaccurate to answer but let me give you
I am currently working on a project, let me explain the global idea :
Let me give my question some context. I have a JavaScript widget. The widget
Let's say i have two tables in db: Car and Part. Car owns arbitrialy
Let's assume we have the following structure: index.php config.inc.php \ lib \ lib \

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.