wood burning stoves 2.0*
The moose likes JSF and the fly likes Passing parameter between pages and populating page with values. Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Spring in Action this week in the Spring forum!
JavaRanch » Java Forums » Java » JSF
Bookmark "Passing parameter between pages and populating page with values." Watch "Passing parameter between pages and populating page with values." New topic
Author

Passing parameter between pages and populating page with values.

sharath kumar reddy karnati
Greenhorn

Joined: Jul 23, 2007
Posts: 5
Hi All,

Say I have 2 java beans.

EmployeeBean.java( 3 properties with getters and setters)
-------------------
empId
empLoginName
empPassword

EmployeeDetailBean.java ( 3 properties with getters and setters)
-------------------------
empId
empFirstName
empSecondName

And I have 2 jsp pages(empLogin.jsp,empDetail.jsp)

User will enter Login & password in empLogin.jsp page and it will have a method will check user credentials and it will return empId in case of success.

When user login & password is correct I'd like to send this empId to empDetail.jsp page and I'd like to query employeedetail table based on empId and show employee details on empDetail.jsp page.

Please let me know how to do these tasks for above situation:

1. How to pass empId between the pages. ( EmployeeBean.java bean is in session scope).

2. In empLogin.jsp, I have submit button where I'm calling checkUser() method for validating empLoginName and password, in this method I'm calling antother method selectEmployeeDetail(which will retrive data for given empId) in EmployeeDetailBean.java, this method is invoking fine but the data is not showing up in empDetail.jsp page.

3. In dataTable tag, we can invoke a method from java bean to populate data but how to do similar in <h:form> tag.

Thanks in advance.

Regards,
Sharath.
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Passing parameter between pages and populating page with values.