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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 3, 20262026-06-03T14:59:32+00:00 2026-06-03T14:59:32+00:00

I have a web application which basically process entries of the user when the

  • 0

I have a web application which basically process entries of the user when the commandButton is hit, then receives a response/result message of the transaction and should be displayed in another JSF page.

Here’s a sample what I want to do: I’m using JSF2 and primefaces

registration.xhtml – starting point for the transaction

RegistrationBean – backing bean used by registration.xhtml
– has the “create” (also processes the data entered and supposedly sets up the ResultBean) method invoked via the commanButton on registration.xhtml then return string for navigation (to result.xhtml)

result.xhtml – result UI of the transaction

ResultBean – holds values needed by the result.xhtml

I’ve been searching for samples over the internet and seem can’t find one. Is there a way to accomplish this? And if none, maybe a workaround? I’m a beginner using this. Any help would be greatly appreciated. Thanks in advance!
See below for sample code.

registration.xhtml:

<h:form style="position: absolute" id="basicPartyRegistration">
<h:panelGroup>
    <h:commandButton id="createButton1"  action="#{partyRegistration.create}" value="Create">
    </h:commandButton>
    <h:button outcome="welcome" value="Main Page" id="mainPageButton" />
</h:panelGroup>
<br />
<h:panelGroup>
    <p:panelGrid columns="2">
    <h:outputText value="Receiver:" />
    <h:inputText id="receiver"
        value="#{partyRegistration.partyRegistrationInfo.receiverGLN}"
        size="15" maxlength="13" />
    <h:outputText value="TransmittingData:" />
    <h:inputText id="transmittingDataPool"
        value="#{partyRegistration.partyRegistrationInfo.transmittingDataPool}"
        size="15" maxlength="13" />
    <h:outputText value="PartyData:" />
    <h:inputText id="partyData"
        value="#{partyRegistration.partyRegistrationInfo.partyDataPool}"
         size="15" maxlength="13" />
</p:panelGrid>

.....
.....

RegistrationBean:

@ManagedBean (name = "partyRegistration")
@viewScoped //Changed to @ConversationScoped
public class RegistrationBean implements Serializable{
    private String receiver
    private String transmittingData;
    private String partyDataPool;
    @ManagedProperty (value = "resultBean")
    private Result result;
    // more variables
    //public getters and setters

    public String create(){
       // do some processing
       // some magic way to set RESULT bean to be used in the next page
       return "result";
    }
}

result.xhtml

<h:form style="position: absolute" id="partyRegistrationResponse">
<h:panelGroup>
<h:button outcome="welcome" value="Main Page" id="mainPageButton" />
</h:panelGroup>
<br/>
<h:panelGroup>
<p:panelGrid columns="4">
    <h:outputText value="Last Date Changed: " />
    <p:inputText id="lastDateChg" value="#{partyResponse.lastChangedDateItem}"
        title="Last Date Changed" size="15" >
    </p:inputText>

</p:panelGrid>
<h4>Response Identification</h4>
.....
.....

ResultBean:

@ManagedBean (name = "partyResponse")
@ViewScoped //changed to @ConversationScoped
public Class ResultBean implements Serializable{
    private Date lastChangedDateItem;
    //more variables
    //getters and setters
}

faces-config.xml

<navigation-rule>
    <navigation-case>
        <from-outcome>result</from-outcome>
        <to-view-id>/result.xhtml</to-view-id>
    </navigation-case>
</navigation-rule>
  • 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-03T14:59:33+00:00Added an answer on June 3, 2026 at 2:59 pm

    Try to create the ResultBean in your RegistrationBean’s create() method and put it in a qualified scope the programmatic way. ViewScope may not be the right choice, since you are leaving the registration view.

    To survive a redirect, put it into flash scope.

    FacesContext.getCurrentInstance().getExternalContext().getFlash().putNow("partyResponse", resultBean);
    

    You should have a look at conversation scope, too, which is useful to store beans for a sequence of pages, that belong to one use case.

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

Sidebar

Related Questions

I have a web application in which a user has to upload images to
I have created an ASP.NET Webforms web application which basically inetracts with the code
I have an informational pop-up modal in my web application, which is basically just
I have web application which we deployed in a production . We have separate
I have web application of which major part is javascript. I request images from
I have a web application which contains both secure (SSL) and non-secure pages. A
I have a web application which is deployed by the means of Flask. I'm
Using JDeveloper as my IDE, I have a web application which calls services provided
I have a web-based application which is very highly reliant on jquery / javascript,
I have a struts2 web application which accepts both POST and GET requests in

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.