Im using this code to call a servlet on another machine that runs
tomcat.
void sendData(String s)throws Exception{
URL servlet= new URL( "http://192.168.0.5:8080/servlet/HelloServlet" );
URLConnection servletConnection = servlet.openConnection();
servletConnection.setDoInput(true);
servletConnection.setDoOutput(true);
servletConnection.setUseCaches (false);
servletConnection.setDefaultUseCaches (false);
servletConnection.setRequestProperty ("Content-Type",
"application/octet-stream");
ObjectOutputStream outputToServlet = new
ObjectOutputStream(servletConnection.getOutputStream());
Permission p = servletConnection.getPermission();
outputToServlet.writeObject(s);
String ss = servletConnection.toString();
outputToServlet.flush();
outputToServlet.close();
}
This url "http://192.168.0.5:8080/servlet/HelloServlet" brings a
response from the browser. The servlet is expected to respond to doGet
method. I have searched books, web info and tomcat docs. The application
that sends the data does not exception. Why doesnt this work???
___________________________________________________________________________
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