• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
  • Campbell Ritchie
  • Ron McLeod
  • Rob Spoor
  • Tim Cooke
  • Junilu Lacar
  • Henry Wong
  • Liutauras Vilda
  • Jeanne Boyarsky
Saloon Keepers:
  • Jesse Silverman
  • Tim Holloway
  • Stephan van Hulst
  • Tim Moores
  • Carey Brown
  • Al Hobbs
  • Mikalai Zaikin
  • Piet Souris

Quick question about reading a Bean reading a JSF inputLabel

Ranch Hand
Posts: 362
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I have a registration page which forwards to a confirm page, how can I get my RegistrationBean to grab the values of my outputLabels

<h: outputText value="#{reg.email}" />


private String email

I keep getting 'null', so I guess I shouldn't be using a h: outputText, but what should I be using?
The only other thing I can think to do is add a inputHidden for each param in my confirmation page:
e.g: <h:inputHidden name="email" id="email" value="#{reg.email}" />

Saying that, why has my Bean lost the values for firstname, surname etc yet it is able to display them in the JSF page?

Here is the code for viewing:-

Enter Details page:

Confirm page:



Ranch Hand
Posts: 132
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi Keith,

I have't use facelets much and I don't know nothing about the FacesContextManager (class/interface ? - Do you have further infos?), but I would assume that the forward and/or redirect method of FacesContextManager can be a problem.

I had assumed that you return a String in your confirm()-method and then over the specific navigation-rule in your faces-config.xml do the forward to your result page. Why don't you use this common approach?

You 've bind your bean "reg" only on the request-scope. I'm not sure that this FacesContextManager takes care that your request-values from your input page are also available in your result page. You can also try it out to bind your managed bean at the session scope, does you still get a null value?

Best regards,
eat bricks! HA! And here's another one! And a tiny ad!
Thread Boost feature
    Bookmark Topic Watch Topic
  • New Topic