Win a copy of Think Java: How to Think Like a Computer Scientist this week in the Java in General forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Response SendRedirect

 
S Subbu
Ranch Hand
Posts: 87
jQuery
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator

Hi,

Please Give me clarrification about this topic.

When i use response.sendRedirect("somedomain") what happen to my Session.

I want to use same Session in other domain also Is it possible.
 
Bear Bibeault
Author and ninkuma
Marshal
Pie
Posts: 64827
86
IntelliJ IDE Java jQuery Mac Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
You can't. A session is specific to one browser in one web app. If the other site needs data, you'll need to pass it on the request URL.
 
Pat Farrell
Rancher
Posts: 4678
7
Linux Mac OS X VI Editor
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Bear Bibeault wrote: If the other site needs data, you'll need to pass it on the request URL.


or better, pass a nonce as a parameter to the request URL, and have the other site use the nonce to fetch the data it needs out of channel.
 
S Subbu
Ranch Hand
Posts: 87
jQuery
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Ok , how to pass my session attributes?

response.sendRedirect(response.encodeRedirectURL("somedomain"))

What happen when i use the above statement ?

Is That statement include my session attributes to the other domain session ?
 
Bear Bibeault
Author and ninkuma
Marshal
Pie
Posts: 64827
86
IntelliJ IDE Java jQuery Mac Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
No. As already stated you'd need to include them on the URL yourself. Are you limited to a redirect? Can the other server handle a POST?

Of course, in a truly modern system this would be handled by a web service.
 
S Subbu
Ranch Hand
Posts: 87
jQuery
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Oh ok,

i am unaware of web services . My Requirement is in my project is online Payment System(I was new to this type of payments).

How can i connect to other domain(for ex : somebank domain) and how i pass my session attributes.

I need to know webservices ?

Webservices minimize my problems?



Any idea to continue my work.
 
vipul bondugula
Ranch Hand
Posts: 219
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
S Subbu wrote:Oh ok,

i am unaware of web services . My Requirement is in my project is online Payment System(I was new to this type of payments).

How can i connect to other domain(for ex : somebank domain) and how i pass my session attributes.

I need to know webservices ?

Webservices minimize my problems?



Any idea to continue my work.



Yes. web services solves your issue in easy manner. you can also go for EJB.

Difference between EJB and Web services is :

EJB is homogenuous, while webservices are heterogeneous.

Directly you cannot pass data from your domain to another domain. As bear bibeault said, You can pass them from request URL.
 
Pat Farrell
Rancher
Posts: 4678
7
Linux Mac OS X VI Editor
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
S Subbu wrote:i am unaware of web services . My Requirement is in my project is online Payment System(I was new to this type of payments).


Online payment systems have been solved technology since the turn of the century. Doing a real payment system (as opposed to a college programming assignment) from scratch is a huge amount of work -- there are many commercial solutions that are well tested, documented and run.

As a learning experience, it can make sense, if the rigor required is modest.

For a commercial product, unless you are Amazon or Apple, it makes zero sense to reinvent the wheel.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic