• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

Forwarding a request to a sevlet inside context on another web server.

 
Ranch Hand
Posts: 112
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I have written one servlet from which I want to pass the objects created in it to a servlet on another server. I have tried it with the sendRedirect method. It is working fine for simple strings when appended with the url query string, but how can I send bulk amount of data with the request and also have a response from there?
I have also tried using forward method, but it doesnt work for remote contexts even if a reference to remote context is acquired.
 
author
Posts: 181
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
A forward stays on the server and is part of the same request. So you can store data as an attribute and forward. If you need to redirect to a Servlet that is part of another application on another box, redirect is always a GET reuest so the URL string is all you have.
 
Ashish Agrawal
Ranch Hand
Posts: 112
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

Originally posted by Roland Barcia:
A forward stays on the server and is part of the same request. So you can store data as an attribute and forward. If you need to redirect to a Servlet that is part of another application on another box, redirect is always a GET reuest so the URL string is all you have.


Thats right...but as I mentioned in my post, I want to send objects and not just character data. Is there any other way like using URLConnection,etc.? If yes, how?
- Ashish Agrawal.
 
Greenhorn
Posts: 16
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Here is some quick and dirty JSP to demonstrate. Put both files in the same directory.
------------sender.jsp----------------------------------------
-------------------------------bouncer.jsp--------------------------
 
Ashish Agrawal
Ranch Hand
Posts: 112
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Thank you very much Rick
 
Consider Paul's rocket mass heater.
reply
    Bookmark Topic Watch Topic
  • New Topic