This week's book giveaway is in the Design forum.
We're giving away four copies of Building Microservices and have Sam Newman on-line!
See this thread for details.
The moose likes JSF and the fly likes JSF request parameters Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Building Microservices this week in the Design forum!
JavaRanch » Java Forums » Java » JSF
Bookmark "JSF request parameters" Watch "JSF request parameters" New topic
Author

JSF request parameters

Pradyut Bhattacharya
Ranch Hand

Joined: Aug 12, 2004
Posts: 63
Hi
I want to get the value of a text field "textField1" in a Page1
Im able to forward to Page2 via a button but I want to retrieve the value of textfield in page2

The code i wrote in prerender function is: -
label1.setText(FacesContext.getCurrentInstance().getExternalContext().getRequestParameterMap().get("Page1.textField1"));

where label1 is a label in Page2
but I do not get any value in Label1.

Any Help

Thanks
Pradyut
http://pradyut.tk
India


Pradyut
http://pradyut.tk/
A. Dusi
Ranch Hand

Joined: Sep 27, 2004
Posts: 114
What is the scope of your backing bean for Page1? If it is in session scope, you can simply access the textfield in Page2 the same way you are accessing it on Page1.
If the scope is request and if you are using MyFaces implementation, check out the t:saveState tag on MyFaces Wiki page.
 
I’ve looked at a lot of different solutions, and in my humble opinion Aspose is the way to go. Here’s the link: http://aspose.com
 
subject: JSF request parameters
 
It's not a secret anymore!