This week's book giveaway is in the Servlets forum.
We're giving away four copies of Murach's Java Servlets and JSP and have Joel Murach on-line!
See this thread for details.
The moose likes Servlets and the fly likes trying to post from servlet to web server Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Murach's Java Servlets and JSP this week in the Servlets forum!
JavaRanch » Java Forums » Java » Servlets
Bookmark "trying to post from servlet to web server" Watch "trying to post from servlet to web server" New topic
Author

trying to post from servlet to web server

Ray Smilgius
Ranch Hand

Joined: Jan 29, 2001
Posts: 120
here is the scenerio
client(browser) makes a post to servlet then I need to repost that to a remote web server on another machine.
I am getting unexpected end of file from web server
according to my web server it records to posts with the same time stamp it is a basic echo server it works find from browser to web server returns thye posted data in the browser but when i call the servlet with the post it records to posts on the server with the same time stamp. I use url connection inside of the doPost and I also tryed it in the doGet().. Any ideas would be greatly appreciated
Thanks Ray


SCJO, SCJD, SCWCD, I-Net+, A+, Network+, MCSD, MCDBA, MCP, MCT
William Brogden
Author and all-around good cowpoke
Rancher

Joined: Mar 22, 2000
Posts: 12760
    
    5
1. Be sure you set the Content-Length and Content-Type when POSTing.
2. Do not close the output stream, just flush it.
WBB
------------------
author of:
Ray Smilgius
Ranch Hand

Joined: Jan 29, 2001
Posts: 120
I will try this at work tomorrow.
Thanks Alot Bill
 
It is sorta covered in the JavaRanch Style Guide.
 
subject: trying to post from servlet to web server
 
Similar Threads
? extends String
How about an "Is Java Dying" forum?
Trying to post from servlet directly to server see code
Disply records on Browser
Some Server Side Caching?