I ran Tomcat on localhost and everything's the same. I don't have firewall
and I disabled antivirus, so there's nothing between client and tomcat. So
the problem is either in client code (or JDK?) or in Tomcat. I'm posting
full client code once again to show how I'm connecting to server

Thanks,
Andrey

--------------
public static void main(String[] args) throws Exception {
        String address = "http://localhost:8097/Dove";;
        File pack = new File("build.xml");

        URL url = new URL(address);
        HttpURLConnection connect = (HttpURLConnection)
url.openConnection();
        connect.setRequestMethod("POST");
        connect.setDoInput(true);
        connect.setDoOutput(true);
        connect.setUseCaches(false);

        OutputStream out = connect.getOutputStream();
        FileInputStream in = new FileInputStream(pack);
        IOUtils.copy(in, out);
        out.flush();
        in.close();

        if (connect.getResponseCode() != HttpURLConnection.HTTP_OK) {
            System.err.println("file " + pack.getPath() + " was not
transfered - response code " +
                    connect.getResponseCode());
        }
        else {
            System.out.println("file " + pack.getPath() + " transfered");
        }
    }

2009/4/7 Caldarale, Charles R <chuck.caldar...@unisys.com>

> > From: Andrey Razumovsky [mailto:razumovsky.and...@gmail.com]
> > Subject: Re: Cannot read httpservlet's inputstream
> >
> > I'm sending POST request from Java (see code in my first message)
> > to Tomcat 6. But, somehow, the request comes there is GET (!) Also
> > Content-Length, Content-Type and other header parameters are reset
> > to default values
>
> Tomcat won't be doing this.  What else is between your client program and
> Tomcat?  (E.g., proxies, httpd, smart (?) firewall?)
>
> > And mainly, servlet's input stream is empty.
> > When I do POST from simple HTML,everything's fine.
>
> Try running Wireshark or equivalent on both the client box and the Tomcat
> box to see exactly what's being put on the wire from the points of view of
> both ends.
>
>  - Chuck
>
>
> THIS COMMUNICATION MAY CONTAIN CONFIDENTIAL AND/OR OTHERWISE PROPRIETARY
> MATERIAL and is thus for use only by the intended recipient. If you received
> this in error, please contact the sender and delete the e-mail and its
> attachments from all computers.
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
> For additional commands, e-mail: users-h...@tomcat.apache.org
>
>

Reply via email to