aspose file tools*
The moose likes Servlets and the fly likes Is it possible to pass an object in a request from one app server to another? Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of The Java EE 7 Tutorial Volume 1 or Volume 2 this week in the Java EE forum
or jQuery UI in Action in the JavaScript forum!
JavaRanch » Java Forums » Java » Servlets
Bookmark "Is it possible to pass an object in a request from one app server to another?" Watch "Is it possible to pass an object in a request from one app server to another?" New topic
Author

Is it possible to pass an object in a request from one app server to another?

Roger Graff
Ranch Hand

Joined: May 29, 2001
Posts: 112
Is it possible to pass an object in a request from one app server to another?
I want a user to be able to click a link in a portal page, the portal app stores user info inside a HttpServletRequest object, and forward the request to another application running on a separate application server. Is this possible?
Thanks!
Roger
Tony Alicea
Desperado
Sheriff

Joined: Jan 30, 2000
Posts: 3222
    
    5
As far as I know, request forwarding is only within the same web app.
However, you can always build a query string with the user data and POST to the other app.


Tony Alicea
Senior Java Web Application Developer, SCPJ2, SCWCD
DC Dalton
Ranch Hand

Joined: May 28, 2001
Posts: 287
A query string as Tony mentioned is probably the only way to accomplish this across multiple servers. Unfortunately if security is a concern (username, passwords etc) this is completely out of the question & is a VERY dangerous situation. Even a cookie (Yuck) would be refused due to server & browser security implementations. Also you mentioned sending an object which plain & simple will not work.
Remember the response - request object only grab / write standarized data from the headers so in fact the response object re-writes the data from the object into a form that is standarized for internet transfer (basically Strings). The request then grabs this data, parses it & puts it into what we know as the request object.
This is a tough proposal no matter how you shake it & I think unitl the "next generation" of internet protocols are created we are stuck with this.
 
It is sorta covered in the JavaRanch Style Guide.
 
subject: Is it possible to pass an object in a request from one app server to another?