aspose file tools*
The moose likes Servlets and the fly likes request redirection and session Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » Servlets
Bookmark "request redirection and session" Watch "request redirection and session" New topic
Author

request redirection and session

nandkishor rao
Ranch Hand

Joined: May 24, 2006
Posts: 53
Hi,

What happens to Session and Session attributes when :

1.) a request is Redirected "currentApplication"?
2.) a request is Redirected "differentApplication"?
Bear Bibeault
Author and ninkuma
Marshal

Joined: Jan 10, 2002
Posts: 61652
    
  67

The answer in both cases is: nothing. The session and its scoped variables are unaffected.

Of course, in the second case, the session (and its variables) are not accessible by the second web app and will eventually time out.
[ May 22, 2008: Message edited by: Bear Bibeault ]

[Asking smart questions] [Bear's FrontMan] [About Bear] [Books by Bear]
nandkishor rao
Ranch Hand

Joined: May 24, 2006
Posts: 53
Thanks for answering.
In the case (2), say in my first application I created a session and then redirected the request to different application. So you mean to say that I cannot access the session attributes here? Please explain.
But within a timeout period if I redirect my request from this application to the one where I created a session what happens in that case, will I be able to access the session and session attributes back again?
Bear Bibeault
Author and ninkuma
Marshal

Joined: Jan 10, 2002
Posts: 61652
    
  67

Sounds like something that's simple enough to test with a few simple classes. What happens when you try it?
nandkishor rao
Ranch Hand

Joined: May 24, 2006
Posts: 53
I know that simple enough to test but my problem is I don't have that much time this time to test, that's why I posted this in the forum to get some help on it beforehand.
Bear Bibeault
Author and ninkuma
Marshal

Joined: Jan 10, 2002
Posts: 61652
    
  67

In the time you waited for this post, you could have easily tested this. Once thing you will find is that if you are not willing to put in your own effort, you cannot expect others to put in more effort than you yourself are willing to expend.

Please read this for more information.
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: request redirection and session