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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 19, 20262026-05-19T04:14:29+00:00 2026-05-19T04:14:29+00:00

Im confused regarding which scope should i use. Here i have a module, that

  • 0

Im confused regarding which scope should i use.

Here i have a module, that consist of 4 level of pages like page browse – page header – page detail of that header – page sub detail of that detail. Im thinking that each page would have it’s own managedbean’s.

The deepest level, level 4 (the sub detail page), would be able to access every other managedbean’s state in the outer level. The level 3 (the detail page) could access level 2 managedbean’s state (header page) and level 1 managedbean’s state (browse).

The outer managedbean’s wont be able to access the deeper managedbean’s state

Using request scope will not do, since the deep level pages need to access other state in outer levels.

Using session scope will do, but will memory consuming when the user switch to other unrelated program modules, and those unused beans will stay in the memory as long as the session. And moreover, i cant open these chains of pages in different tabs.

Using conversation scope is confusing for me also, since i dont have a clear begin() and end() like a wizard style pages, or quiz pages. The user could switch back n forth with these pages and do actions in any page.

Using view scope seems possible, but i must use the parameter passing from one page to another. The deeper level beans wont be able to access the outer beans, but they could receive the string parameters from the previous page. This kinda ugly, because i might need to query many information from the database again that could have been done in the previous managed bean.

Am i thinking wrong ?

Please share your thoughts.

Thank you,
Albert Kam

  • 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-19T04:14:29+00:00Added an answer on May 19, 2026 at 4:14 am

    The new Flash scope in JSF 2 might help you. Think of it like a Session scope that is cleared after it’s read once. It’s a bit different than the other scopes in that it’s not an annotation, but a Map. You could put all info from page1 that page 2 requires in the flash scope, read it a PostConstruct annoted method in page2, then put in all data required by page 3 and so forth. Slightly messy, but at least you won’t need to use view parameters. The actual managed beans could be Requestscoped. It would look something like this:

    Level1Bean

    @public String toLevel2Button(){
        ELFlash.getFlash().put("data1", object1);
        ELFlash.getFlash().put("data2", object2);
        return "level2";
    

    Level2Bean

    @PostConstruct
    public void init(){
        object1 = (MyType1)ELFlash.getFlash().get("data1");
        object2 = (MyType2)ELFlash.getFlash().get("data2");
    }
    
    public String toLevel3(){
        ELFlash.getFlash().put("data1", object1);
        ELFlash.getFlash().put("data2", object2);
        ELFlash.getFlash().put("data3", object3);
        return "level3";
    }
    

    You can find a short example here. The flash scope can be read directly from the View aswell. Besides this, i can’t think of any way to transfer data between views without using view parameters.

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

Sidebar

Related Questions

I'm really confused. I want to do something that a) seems like it should
I am learning about SOAP implementation and have become somewhat confused regarding the appropriate
I'm a bit confused here. Microsoft as far as I can tell claims that
After much research I am a little confused by which identity tracker I should
I need help regarding DDA algorithm , i'm confused by the tutorial which i
I am a little confused right now regarding C++ reference semantics. Suppose I have
I'm a little confused about how the standard library will behave now that Python
I have many TextBOX in asp.net which accepts the value from user and stores
I have an application which was developed under Windows, but for gcc. The code
I recently posted a question which was answered by Bryan Watts, regarding generic repository

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.