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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 27, 20262026-05-27T05:37:07+00:00 2026-05-27T05:37:07+00:00

A request scoped bean collects data, from all many other request beans & business

  • 0

A request scoped bean collects data, from all many other request beans & business logic. This bean is used through the EL expressions in the page but before this request scoped bean may be used in the page, it needs to build a directory using the collected data (This is done after all collection is over but before the bean properties may be used in page).

How can I execute the building of the directory in this bean after all collection but before it is used through the EL expressions in the page without using <f:event>? I need to build it only once.

@ManagedBean(name="namesDirectory")
@RequestScoped
public class NamesDirectory { 

    public void addForPersonNameRetrieval(Integer id) { // this is used to collect the data in bean
           peopleNamesMap.put(id,null);
           .......
    }

    public void buildDirectory(){ // used, when all collection is over, to build the diirectory      
           .......
    }

    public String getPersonName(Integer id) { // used in the JSF page through EL expressions
        name = peopleNamesMap.get(id);
    }

}

Here buildDirectory() needs to be executed at the end of all collection but before using getPersonName() in the JSF 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-05-27T05:37:08+00:00Added an answer on May 27, 2026 at 5:37 am

    You have got several options. You could rebuild the directory after every insert or before every retrieval, however this may cause unnecessary rebuilds. You could rebuild the directory only when needed and called:

    • Add a flag requiresRebuild and default it to true.
    • Set it to true in addForPersonaNameRetrieval.
    • Set it to false in buildDirectory.
    • Call buildDirectory in getPersonName if a rebuild is necessary.
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I need to instantiate a session bean from another request scoped bean & set
I would like to make use of request scoped beans in my app. I
I have a request scoped bean, and I need to have access to the
I'm trying to do this (code) in old school xml. @Bean @Scope(value=request, proxyMode=ScopedProxyMode.INTERFACES) public
For using spring request scope bean is this definition correct? <bean id=shoppingCart class=ShoppingCart scope=request>
How does Spring know when to call 'destory' method on a session/request scoped bean
I instantiated a request bean from another request bean, new LoginManager(); But the property
Spring: 2.5.6.SEC01 DWR: 2.0.5 I would like to use a session scoped bean from
I'm trying to understand the request scoped beans. Suppose I have a controller and
I have a (request-scoped) list from which the user may select a PQ (list

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.