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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 8, 20262026-06-08T08:09:16+00:00 2026-06-08T08:09:16+00:00

I have a small JSF application and the scope of the pages are request

  • 0

I have a small JSF application and the scope of the pages are request. I would like to have a method in my JSF’s managed bean for logging user_id and page name to database. When I added this method to the constructor of bean, details are getting logged for every method is being called due to the fact that scope of the page is request.

What is the best way to log the above details only once when user first access the pages after logging into my application? Idea is which all pages user visited for each logging.
What is the best way to achieve this?

My JSF version is 1.1.

Thanks

  • 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-08T08:09:17+00:00Added an answer on June 8, 2026 at 8:09 am

    You can add a method to the bean and invoke it from the page when the page is loaded. For example

    add this into the page:

    <h:outputText value="#{fooBean.logUser}"/>
    

    bean method:

    public void logUser(){
        //log user and page
    }
    

    This way the method is only invoked once the page is loaded. If you get a method not found
    error, then another option is to use a hidden form hack. For example:

    <body onload="document.getElementById('formId:buttonId').click()">
        <h:form id="formId" style="display: none;">
            <h:commandButton id="buttonId" value="submit" action="#{fooBean.logUser()}" />
        </h:form>
        ...
    </body>
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a small JSF app and would like to keep some state on
I have a small JSF web application on WAS7.0 with just one page but
I have a small JSF application where the user is required to enter some
I have small application using JSF 1.1. It is using NTLM for authentication. What
I am implementing small software with JSF. I would like to show users' photos
I have a small web application developed using Icefaces 1.8.2 and jsf 1.1 which
have small problem, and would very much appreciate help :) I should convert byte
I have small question. When I started to programm my application, I grouped types
i want to implement a small search engine , i have index page where
I have small page, it looks follows: Some header Label with text only for

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.