Win a copy of Re-engineering Legacy Software this week in the Refactoring forum
or Docker in Action in the Agile forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

JSF request parameters

 
Pradyut Bhattacharya
Ranch Hand
Posts: 63
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
 
A. Dusi
Ranch Hand
Posts: 114
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic