A servlet is running on tomcat 3.1 standalone. I have been trying to get
an application (not applet) to open a URL connection to the servlet.
Below is the code executed from a button push event
try
{
URLConnection sc =
openConnection("http://192.168.0.4:8080/servlet/helloworld.HelloServlet");
String t = sc.toString();
sc.setDoOutput(true);
sc.setDoInput(true);
sc.setUseCaches (false);
sc.setDefaultUseCaches (false);
sc.setRequestProperty ("Content-Type",
"application/octet-stream");
OutputStream s =sc.getOutputStream());
s.write(99);
s.flush();
s.close();
}
catch(Exception ex)
{
System.out.println("exception");
}
The servlet is on another machine and I can run it with a browser
pointed at "http://192.168.0.4:8080/servlet/helloworld.HelloServlet"
from the same machine where the application that is failing to connect
is running??
Any help would be appreciated
Mark Lintner
===========================================================================
To unsubscribe: mailto [EMAIL PROTECTED] with body: "signoff JSP-INTEREST".
Some relevant FAQs on JSP/Servlets can be found at:
http://java.sun.com/products/jsp/faq.html
http://www.esperanto.org.nz/jsp/jspfaq.html
http://www.jguru.com/jguru/faq/faqpage.jsp?name=JSP
http://www.jguru.com/jguru/faq/faqpage.jsp?name=Servlets