Win a copy of Svelte and Sapper in Action this week in the JavaScript forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Ron McLeod
  • Paul Clapham
  • Bear Bibeault
  • Junilu Lacar
Sheriffs:
  • Jeanne Boyarsky
  • Tim Cooke
  • Henry Wong
Saloon Keepers:
  • Tim Moores
  • Stephan van Hulst
  • Tim Holloway
  • salvin francis
  • Frits Walraven
Bartenders:
  • Scott Selikoff
  • Piet Souris
  • Carey Brown

Passing parameter between pages and populating page with values.

 
Greenhorn
Posts: 5
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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.
 
To do a great right, do a little wrong - shakepeare. twisted little ad:
the value of filler advertising in 2020
https://coderanch.com/t/730886/filler-advertising
    Bookmark Topic Watch Topic
  • New Topic