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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 19, 20262026-05-19T16:12:48+00:00 2026-05-19T16:12:48+00:00

When a user logs into my website I want to display a div with

  • 0

When a user logs into my website I want to display a div with a user menu, that contains his inbox, notifications, etc. Do I have to use JAAS with JSF to accomplish this? What’s the best way to do it? If you could point me in the right direction or maybe some tutorial, or if there’s some fancy way to do this instead of using the render attribute. Thanks in advance.

  • 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-19T16:12:48+00:00Added an answer on May 19, 2026 at 4:12 pm

    If your security requirements are not complicated, a simple way of doing this without Jass is by using a session scoped bean for the user details.

    The div in which you present the logged in\ logged data to the user will be controlled by this bean.

    you will not have to use render, depending on what you wish to display to the user.

    for example, a message to the user can be displayed always as

    <h:outputText value="#{UserSession.userMessage}"> 
    

    even if the user is logged out.

    I would however consider using the render attribute.

    Hope this helps

    Added a simple example of session bean.
    you can add details to the bean however I would suggest adding the minimum needed.
    from this bean you will be able monitor the user.

    from java:

    SessionBean session = (SessionBean)FacesUtils.findBeanInSession("SessionBean");
    

    from jsf files, using render on its attributes. i added getLoggedIn method as an example.

    java class:

    public class SessionBean implements Serializable{
        private static final long serialVersionUID = -867309384910092832L;
    
        private int     userRole;
        private int     userId;
        private String          userName;
    
        public boolean isLoggedIn ()
        {
            return userId>0 ;   
        }
    }
    

    faces config:

    <managed-bean>
            <managed-bean-name>SessionBean</managed-bean-name>
            <managed-bean-class>com.yourPackage.beans.SessionBean</managed-bean-class>
            <managed-bean-scope>session</managed-bean-scope>
        </managed-bean>
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a website in PHP, and I want that when user logs in
I have a website, with a user system. I want to integrate wordpress's user
When a user logs in into a website and it has a specific page
User A logs into a ticket management system to edit content on SomePage.aspx User
When a user logs in to my site I want a css styled button
In my web app, when a user logs in, I add his Id to
I am developing the user management portion of a website that will host a
Below is my code. For some reason, after the user logs into the little
I am trying to rewrite some server php code which logs into a website,
When a user logs in, I give them a cookie named auth with a

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.