Win a copy of Programmer's Guide to Java SE 8 Oracle Certified Associate (OCA) this week in the OCAJP forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Loosing session and request object while doing response.sendRedirect(url)

 
Rashmi Anand
Greenhorn
Posts: 11
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi ,

I have two applications which are hosted in two different domains.

I have to pass the control from 1 application of 1 domain to another application in different domain.
I cant use requestDispatcher because they are in different domains.

As of now i am using sendRedirect(url): url which is a String is having differt domain application url.
The control is passed but the attributes i had set in session and request objects are not available.

Please let me know how can i retain session and request objects after giving control to different application.

TIA
Rashmi
 
Ra Re
Greenhorn
Posts: 6
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Employing sessions across JVMs (two different domains) requires an HttpSessionActivationListener

Some info:
http://faq.javaranch.com/java/HttpSessionActivationListener
http://www.coderanch.com/t/474955/Servlets/java/What-happened-session
 
Deepak Bala
Bartender
Posts: 6663
5
Firefox Browser Linux MyEclipse IDE
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
What you are asking for cannot be done. You cannot pass sessions that exist in say gmail.com and send them over to yahoo.com.

Raimon what you are pointing to is an interface that acts as a call back when objects are migrated across JVMs. This usually happens with fail over scenarios or to maintain hot backups and load balance. Session objects as such cannot make a migration

You can pass your parameters over as request parameters
 
Ra Re
Greenhorn
Posts: 6
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
That's true, my mistake.

Thanks for the explanation!
 
Rashmi Anand
Greenhorn
Posts: 11
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thanks Guys for all the reply.
I am planning to send the required details by appending to the URL in response.sendRedirect()
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic