Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

Data sharing between two servlets across applications

178 views
Skip to first unread message

Balaji Kameswaran

unread,
Feb 17, 2003, 7:21:04 PM2/17/03
to
Hi,

I have a interesting scenario, where I need to transfer data between 2
servlets. The serlvets are stored in 2 different applications and I am
using sendRedirect. I want to use sendRedirect only. (Becasue I know
there are other methods like RequestDispatcher - forwared, URL
encode, which I cannot use for my scenario.). I don't have any problem
in passing a data through any mean. I tried the following and found it
not working.

1. Cookie (this does not work because the transfer happens inside
the server, without going to the browser).
2. session (this does not work because, the servlets are in
different apps.)
3. setHeader (this does not work, i don't know why ????)

Please let me know is there any alternatives or any of the above will
work ?

Thanks for your help.

Balaji

Jason

unread,
Feb 18, 2003, 7:43:41 AM2/18/03
to
Without running a test, my reaction to this is that you will end up
having to forward rather than redirect. You could put your object(s)
into the request and point it at the new URL, but that could have
interesting effects on the session management. In essence you are
trying to shuttle between two different applications, a tricky
prospect at best.

You might give some thought to using something different than a
servlet for your target. Some potential examples include EJB(s) or
Web Services, they're designed for that kind of thing.

I hope my rambling thoughts help.

Jason

bkame...@hotmail.com (Balaji Kameswaran) wrote in message news:<844ee29.03021...@posting.google.com>...

0 new messages