I am trying to pass some parameters from one server to a JSP page on another server, and the receiving JSP page writes those parameters to a text file.

Christopher Koenigsberg

Just use "setRequestProperty" -- "addRequestProperty" does the same thing but won't overwrite an existing value.

You are getting confused by two different uses of the term "request property". In your situation you are setting up an URL Connection which is going to send a request to an arbitrary HTTP server, with new properties you are setting up, in the HTTP headers. The destination server is going to get a new HttpRequest, with properties corresponding to those request property values that you send to it.

In addition, if you are inside a JSP or servlet, there was the HttpRequest that caused you to be initiated in the first place, and there are properties of that request, which came originally in the HTTP headers, and are now available to you. If you use JSP "forward" or "include", or servlet requestDispatcher, the new target JSP or servlet has access to the same HttpRequest, with the same set of properties, that you (the forwarder/includer) have, from the original request HTTP headers.

0 Comments  (click to add your comment)
Comment and Contribute

 

 

 

 

 


(Maximum characters: 1200). You have 1200 characters left.

 

 

About | Sitemap | Contact