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

  • Home
  • SEARCH
  • 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 257961
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 11, 20262026-05-11T22:08:27+00:00 2026-05-11T22:08:27+00:00

I have to warn you: the question may be rather silly, but I can’t

  • 0

I have to warn you: the question may be rather silly, but I can’t seem to wrap my head around it right now.

I have two managed beans, let’s say A and B:

class A
{
    private Date d8; // ...getters & setters
    public String search()
    {
        // search by d8
    }
}

class B
{
    private Date d9; //...getters & setters
    public String insert()
    {
         // insert a  new item for date d9
    }    
}

and then I have two JSP pages, pageA.jsp (the search page) and pageB.jsp (the input page).
What I would like to do is placing a commandbutton in pageB so to open the search page pageA passing the parameter d9 somehow, or navigating to pageA directly after b.insert(). What I would like to do is showing the search result after the insertion.

Maybe it’s just that I can’t see the clear, simple solution, but I’d like to know what the best practice might be here, also…

I though of these possible solutions:

  1. including **A** in **B** and linking the command button with **b.a.search**
  2. passing **d9** as a **hiddenInput** and adding a new method **searchFromB** in **A** (ugly!)
  3. collapsing the two beans into one
  • 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-11T22:08:27+00:00Added an answer on May 11, 2026 at 10:08 pm

    You should configure the navigation flow in faces-config.xml. In ideal scenario you would return a “status” message which would decide the flow. Read more at following link:
    http://www.horstmann.com/corejsf/faces-config.html
    http://publib.boulder.ibm.com/infocenter/rtnlhelp/v6r0m0/index.jsp?topic=/com.businessobjects.integration.eclipse.doc.devtools/developer/JSF_Walkthrough8.html

    As far as passing the values from one page to another is concerned you can use backing beans. More about backing beans here:
    http://www.netbeans.org/kb/articles/jAstrologer-intro.html
    http://www.coderanch.com/t/214065/JSF/java/backing-beans-vs-managed-beans

    Hope i have understood and answered correctly to your question

    Way to share values between beans

    FacesContext facesContext = FacesContext.getCurrentInstance();
    Application app = facesContext.getApplication();
    ExpressionFactory elFactory = app.getExpressionFactory();
    ELContext elContext = facesContext.getELContext();
    ValueExpression valueExp = elFactory.createValueExpression(elContext, expression, Object.class);
    return valueExp.getValue(elContext);
    

    In above code “expression” would be something like #{xyzBean.beanProperty}
    Since JSF uses singleton instances, you should be able to access the values from other beans. If you find more details on this technique, I am sure you’ll get what you are looking for.

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

Sidebar

Related Questions

this may seem like a very basic question, but i have difficulty grasping it,
everyone! i have a question about sessions hopefully someone can help me with. I
I know a lot of question regarding VB6 migration have been asked, but I
(Briefly, like this question but for Windows servers.) I have several Win2003 servers running
I warn you now very little experience at jquery. My question is this. I
I know that this question has been asked loads of times, but I have
This must be an easy question but I can't find a properly answer to
Does gettext have a way to warn me about strings that have not been
I have a DataGridTemplateColumn with DataTemplate as a PasswordBox. I want to warn user
Have a matrix report now that has Position, Hours and Wages for a location

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.