aspose file tools
The moose likes Servlets and the fly likes Save session inside a Servlet Big Moose Saloon
  Search | Java FAQ | Recent Topics
Register / Login


JavaRanch » Java Forums » Java » Servlets
Reply Bookmark "Save session inside a Servlet" Watch "Save session inside a Servlet" New topic
Author

Save session inside a Servlet

Angus Ferguson
Ranch Hand

Joined: Jun 22, 2012
Posts: 281
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: 276

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)..

OCPJP
Bear Bibeault
Author and ninkuma
Marshal

Joined: Jan 10, 2002
Posts: 56549
    
  14

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


[Smart Questions] [JSP FAQ] [Books by Bear] [Bear's FrontMan] [About 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://zeroturnaround.com/jrebel - it saves me about five hours per week
 
subject: Save session inside a Servlet
 
Similar Threads
how to use uploaded file
Problems with servlet filter
accessing session variables when we use sendRedirect
session in netscape 4.7
My servlet Notes