URL url=new URL("http://localhost:8080/Scroll_Sample/index.jsp");
URLConnection conn=url.openConnection();
conn.setDoInput(false);
conn.setDoOutput(false);
i am working on netbeans 5.0 IDE.the above code doesn't work.can
anyone give me any suggestions? is it possible to connect to a servlet
from a javaclass?
Thanks in Advance
> can anyone give me any suggestions? is it possible to connect to a servlet from a javaclass?
Yes, using URLConnection or HttpURLConnection. what you are using is
correct.
> i am working on netbeans 5.0 IDE.the above code doesn't work.
What doesn't work in above code, i.e. what error you are getting? how
are you checking the response code from servlet?
You can probably browse through the URLConnection API's for available
method, all required methods are available for reading and writing to
a servlet, and also for getting servlet response code back.
Regards.
That means that the host port is closed. Typically this means that the server
is not running. It can be complicated by firewall issues.
-- Lew