0

I am totally new to this. I am developing a simple web application where I have a login page to enter username, password, usertype. Depending on the usertype it should open different xhtml pages.

I want to know how can I pass the value of the userID to the pages for further reuse?

session.setAttribute("name", userName);

how can I call this variable from the xhtml page?

Thanks.

lefloh
  • 10,653
  • 3
  • 28
  • 50
Sasha
  • 29
  • 1
  • 2
  • 8
  • I would start by first going through this short [JSP Tutorial](http://www.jsptut.com/), then coming back here if you are still having issues. Embedding the values of server-side variables into the output HTML is a fundamental and basic task. – Jason C Apr 20 '14 at 02:08
  • Thanks.. I am still learning. Highly appreciated. – Sasha Apr 20 '14 at 02:10
  • I read the tutorial, what I cant get to is how to call the "name" from an xhtml page that is redirected by the login.jsp page. – Sasha Apr 20 '14 at 03:48
  • 1
    If you're not generating the target page with a servlet, then you either have to generate the XHTML page with a JSP, or pass it as a GET parameter on redirect, or pass it in a cookie, or any other way you'd pass information around when using non-generated pages. – Jason C Apr 20 '14 at 04:59
  • Possible duplicate of [How can I access session attribute in Facelets page](http://stackoverflow.com/questions/13047446/how-can-i-access-session-attribute-in-facelets-page) – lefloh Apr 20 '14 at 15:47

0 Answers0