Win a copy of Design for the Mind this week in the Design forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Passing parameters to different view

 
Siddharth kumar
Greenhorn
Posts: 6
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hello all,
I have a Login.jsp Page having login information. After validating, I am forwarded to the "Main_Page.jsp"
In Main_Page.jsp I have some links to different Jsp pages.

Now, in these Jsp Pages i want my "login_id" in Login.jsp to be available in all these Jsp pages. How can I do this?
Action Mappings are in session scope.
And one thing is that I am not submitting the "Main_Page.jsp". It is through html:links that i am forwarded to these Jsp pages. So how can i get the Login information.
Pls, suggest?
 
vidya sagar
Ranch Hand
Posts: 580
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
When a person is sucessfully logging in, store the information in session scope and retrieve whereever you want
 
Siddharth kumar
Greenhorn
Posts: 6
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hello Vidya Sagar,
That is what i am asking - How to get the information.???
 
vidya sagar
Ranch Hand
Posts: 580
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I have a Login.jsp Page having login information. After validating, I am forwarded to the "Main_Page.jsp"


Once you sucessfully validating the login(hope you have username and otherinfo related to user for validating), then store username and other related information in the session scope.use where ever you need

Hope now you are clear.
 
Siddharth kumar
Greenhorn
Posts: 6
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hello Vidya Sagar,
As a beginner, i am asking how to store the username in session scope. I mean the syntax for that?

Regards
Siddharth
[ June 12, 2006: Message edited by: Siddharth kumar ]
 
vidya sagar
Ranch Hand
Posts: 580
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
As a beginner, i am asking how to store the username in session scope. I mean the syntax for that?


For setting in session:
request.getSession().setAttribute("username",actualusername); -- servlet
session.setAttribute("username",actualusername); -- in jsp

For retrieving from session:
request.getSession().getAttribute("username"); -- in servlet
session.getAttribute("username"); -- in jsp
 
Siddharth kumar
Greenhorn
Posts: 6
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thanks a lot
From siddharth
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic