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 parameters to different view

 
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?
 
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
 
I didn't like the taste of tongue and it didn't like the taste of me. I will now try this tiny ad:
Building a Better World in your Backyard by Paul Wheaton and Shawn Klassen-Koop
https://coderanch.com/wiki/718759/books/Building-World-Backyard-Paul-Wheaton
    Bookmark Topic Watch Topic
  • New Topic