The moose likes JSF and the fly likes managed bean in JSF. Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » JSF
Bookmark "managed bean in JSF." Watch "managed bean in JSF." New topic

managed bean in JSF.

samarthya saurabh

Joined: May 03, 2010
Posts: 17
I have defined a message bean in the JSF example I use to simply store the Login name and password values to be displayed on the navigated next page. My problem is even though there is no complication error. Only NULL gets set and returned. I have tried to debug and check if the setfunction is called, and it does but with null values and not with the actual text box values.

See below - faces-config.xml

and the login page looks like

and the navigated page is simply

I know I am wrong somewhere, but just seem to oblivious to it. Any help?

eve agostini
Ranch Hand

Joined: Nov 01, 2005
Posts: 43
You need to put the inputText components and the command button in the same form, otherwise the variables in the bean won't be set.
(as an alternative you may use a value change listener)
samarthya saurabh

Joined: May 03, 2010
Posts: 17
I agree. Here's the link:
subject: managed bean in JSF.
It's not a secret anymore!