Win a copy of Think Java: How to Think Like a Computer Scientist this week in the Java in General forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Request vs Session scoped beans in jsf

 
Ven Red
Greenhorn
Posts: 6
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi All

My requirement is :
Page1.jsp - enter first ,last name, gender and Date of birth
request scoped backing bean gets these and goes to next page and displays the same in page2.jsp. In page2.jsp for first name i am using a hyper link which needs to call a session scoped backing bean method and do some logic in the method and go to page3.jsp. I am puzzled why Hyper link doesn't able to call the session scoped method. am i missing any thing?

Thanks
ven
 
Abiodun Adisa
Ranch Hand
Posts: 495
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Would help if you post your page2 and faces-config.xml
 
Richard Green
Ranch Hand
Posts: 536
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
1. Page1.jsf and Page2.jsf would both refer to the same bean (that has first name ,last name, gender and Date of birth). Page1 would use inputText to display the values whereas Page2 would use outputLabels

2. Page3.jsf should be backed up by a managed bean. In the constructor of the backing bean, I would put the bit of logic that you wanted to use when the hyperlink is clicked.
 
Venkata
Ranch Hand
Posts: 37
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi

I would be able to solve my problem by using session scoped beans and resetting them once they are not referring any more.

Thanks to all.

Ven
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic