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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 24, 20262026-05-24T12:52:27+00:00 2026-05-24T12:52:27+00:00

Let’s say I’ve got a register page & a register confirm page. I enter

  • 0

Let’s say I’ve got a register page & a register confirm page. I enter user
details into the register page, navigate to the register confirm page where
I can return back to the register page if there are any mistakes.

I’m going to use view parameters to make the registration data available
from the register page to the confirm page, and vice versa.

Supposing there are 20 items of data to be moving from page to page, that’s
a lot of view parameters and a lot of setPropertyActionListeners, especially
as all the data is going to end up nicely packaged in a User object.

So what I want to do is input the data on the register page into the
properties of a User record and send a reference to it to the register
confirm page. What gave me an idea was seeing the BalusC WeakHashMap
converter. This is a JSF converter which has a static weak hash map and
generates a uuid as the value for a map entry and the object reference as
the key. So by specifying this as a converter for f:viewParam you send
the uuid in the query string.

This works fine. The issue I have is that on the register page I have to
get an instance of a User class with new. Then I can do:

<h:inputText value="#{bean.user.firstname}"/>

(etc…), and pass the user instance as a view parameter. It works fine from
the register to the confirm page. The issue is that when I perform the
reverse, sending the user reference back to the register page from the
confirm page I absolutely cannot prevent the register page backing bean
from re-instantiating the user object, after the setter has been called
as a result of the view parameter.

So the converter does it’s job and retrieves the User object from the
hash map, calls setUser() in the backing bean, and then I see the
constructor for the User class firing.

I’ve tried calling new User() from the bean constructor, in @PostConstruct,
in a preRenderView (also checking if an ajax request), but nothing I try
prevents the work of the view parameter from getting wiped out if new is
involved. I’m sure there’s a simple solution but I just can’t see it right
now.

I’d be grateful for any suggestions for how to solve this problem.

  • 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-24T12:52:27+00:00Added an answer on May 24, 2026 at 12:52 pm

    After several attempts over more than a year to find a solid long term solution
    to this problem, at last! I’ve found one. The solution comes in the form of the
    Apache Myfaces CDI extensions project, aka Myfaces CODI.

    This provides additional scopes such as the @ViewAccessScoped which ensures that
    if a bean is referenced by a page then it is available for that page. Also
    provided is support for conversation groups. In the scenario where I want to
    pass an object reference from a register page to a register confirm page, the
    confirm page can just access the registerView bean directly on the next request.
    Alternatively you can @Inject one bean into another and access it on the next
    request, or use f:setPropertyActionListener from the source page.

    Myfaces CODI works fine with Mojarra and also with ajaxified component libraries
    such as primefaces. The concept is similar to what is provided by Jboss Seam,
    though I’ve found the additional scope support to be better thought out and I’ve
    tested this on glassfish 3.1.1 with no problems.

    If you’re using @ManagedBean and scope annotations from the javax.faces.bean
    package in your code, codi intercepts these annotations and uses it’s own
    CDI based versions, so you can convert to CDI simply by adding codi as a
    dependency to your project and not changing any code.

    For me this is like moving from black and white TV to colour TV, I wish I’d
    found this stuff sooner.

    CODI documentation

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

Sidebar

Related Questions

Let's say on a page I have alot of this repeated: <div class=entry> <h4>Magic:</h4>
Let's say I can call a method like this: core::get() . What is the
Let's say I have an facebook application running using the JS SDK. First user
Let's say after I had login I will be prompt to enter the Name
Let's say I have a dataset, which can be neatly classified using weka's J48
Let's say, I've got a XmlNode: <A>1</A> How to remove a text from it,
Let's say I query for http://images.google.com.sg/images?q=sky&imgcolor=black and I get all the black color sky,
Let's say R is a mxn random matrix. How can generate R with each
let's say I've got: target.o: target.h target.c gcc $(CFLAGS) -c target.c But I'd like
Let's say you create a wizard in an HTML form. One button goes back,

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.