sathish subramanian wrote:
>
> URL t_url = new
> URL("http://192.138.90.31/sathish/servlet/RecordServlet");
Make sure your url is correct. If you have an incorrect URL you should
be seeing an Exception (most likely a SocketException).
> out.print(query.toString());
> out.close();
> }
> catch (IOException e)
> {
> System.out.println("Io exception");
> }
On my system (WinNT, Sybase server) I had problems with your code
because the code was closing the output stream and then doing nothing
with the server response. As soon as I added code to get and read the
response, it worked correctly. Here's an example:
StringBuffer sb = new StringBuffer();
BufferedReader in = new BufferedReader(new
InputStreamReader(conn.getInputStream()));
String inputLine = null;
while ((inputLine = in.readLine()) != null) {
sb.append(inputLine).append("\n");
}
in.close();
I have a servlet that echoes the request, so the code above saves the
response into a buffer which can be printed later. You might be able to
get by with just
InputStream in = conn.getInputStream();
in.close();
___________________________________________________________________________
To unsubscribe, send email to [EMAIL PROTECTED] and include in the body
of the message "signoff SERVLET-INTEREST".
Archives: http://archives.java.sun.com/archives/servlet-interest.html
Resources: http://java.sun.com/products/servlet/external-resources.html
LISTSERV Help: http://www.lsoft.com/manuals/user/user.html