File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
The moose likes JSF and the fly likes Request vs Session scoped beans in jsf Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » JSF
Bookmark "Request vs Session scoped beans in jsf" Watch "Request vs Session scoped beans in jsf" New topic

Request vs Session scoped beans in jsf

Ven Red

Joined: Nov 10, 2007
Posts: 6
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?

Abiodun Adisa
Ranch Hand

Joined: Jan 17, 2002
Posts: 495
Would help if you post your page2 and faces-config.xml
Richard Green
Ranch Hand

Joined: Aug 25, 2005
Posts: 536
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.

MCSD, SCJP, SCWCD, SCBCD, SCJD (in progress - URLybird 1.2.1)
Ranch Hand

Joined: Sep 07, 2007
Posts: 37

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.

I agree. Here's the link:
subject: Request vs Session scoped beans in jsf
jQuery in Action, 3rd edition