wood burning stoves*
The moose likes Servlets and the fly likes Save session inside a Servlet Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Android Security Essentials Live Lessons this week in the Android forum!
JavaRanch » Java Forums » Java » Servlets
Bookmark "Save session inside a Servlet" Watch "Save session inside a Servlet" New topic
Author

Save session inside a Servlet

Isaac Ferguson
Ranch Hand

Joined: Jun 22, 2012
Posts: 331
Hi I want save in session values in my Servlet because, when I redirect to my page with




I the values are no displayed.

Could I set the values I get from processing my Servlet and display them direclty?

Any idea?

Thanks
R. Jain
Ranch Hand

Joined: Aug 11, 2012
Posts: 370
    
    1

Angus Ferguson wrote:
the values are no displayed.

Hello Angus,
Could you explain more clearly what values are you trying to display and where??
How you are passing it?? And how till now are you storing it in session (if so)..
Bear Bibeault
Author and ninkuma
Marshal

Joined: Jan 10, 2002
Posts: 60810
    
  65

The session is not necessary during a forward. Request scope is a better choice.


[Asking smart questions] [Bear's FrontMan] [About Bear] [Books by Bear]
Pongsakorn Semsuwan
Ranch Hand

Joined: May 15, 2011
Posts: 34

This is how you set attribute to request and session. You have to set it before you forward your request to jsp.



Make sure that you understand the differences between session and request scope before choosing one.


And as R.Jain already mentioned, we need more information on what you are trying to do and how's your current situation.


A web application developer wannabe from Thailand
My StartUp : http://www.dreamlog.co
Blog : http://pongsakornsemsuwan.wordpress.com
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Save session inside a Servlet
 
Similar Threads
My servlet Notes
Problems with servlet filter
session in netscape 4.7
accessing session variables when we use sendRedirect
how to use uploaded file