aspose file tools*
The moose likes Servlets and the fly likes An application talking to a Servlet... problem! Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » Servlets
Bookmark "An application talking to a Servlet... problem!" Watch "An application talking to a Servlet... problem!" New topic
Author

An application talking to a Servlet... problem!

Vanchi Nathan
Ranch Hand

Joined: Feb 24, 2004
Posts: 107
Hello all,

Spec..:
currently i have an Java application trying to send a String data to a Servlet that must receive and save it as a file in the server side. The problem is there occurs an Server 500 error..



Can anyone figure why this comes... My application code is as follows:


Best regards,<br /> <br />vanchin
William Brogden
Author and all-around good cowpoke
Rancher

Joined: Mar 22, 2000
Posts: 12806
    
    5
It could be this line:

When doing a URLConnection you should NEVER close a stream until the response has been read. Use flush() to make sure the request is sent. The reason being that close() causes the socket to be closed.
Bill
Vanchi Nathan
Ranch Hand

Joined: Feb 24, 2004
Posts: 107
Hello William,

Thanks for the response....very

My servlet is a simple one and it works when i invoke by a browser...(codes below):

...the problem is with the code in the following java application...(codes below):

The error i get is as follows:


I don't know why the application is not served by the doGet method instead it tell "Unknown Source"...

pl. help...
Vanchi Nathan
Ranch Hand

Joined: Feb 24, 2004
Posts: 107
Correction please..What i stated..
I don't know why the application is not served by the doGet method instead it tell "Unknown Source"...

actually not with doGet method but by doPostmethod..
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: An application talking to a Servlet... problem!