1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29
| try{
DateServletURL = new URL("http://localhost:8080/IFCTech/servlet/huntServlet2"); if( DateServletURL == null ){ System.out.println("Server URL has not been set"); } else { System.out.println("Server URL has been set"); DateServletConnection = DateServletURL.openConnection(); System.out.println("http://localhost:8080/IFCTech/servlet/huntServlet2");
DateServletConnection.setDoInput(true); DateServletConnection.setDoOutput(true);
DateServletConnection.setUseCaches(false); DateServletConnection.setDefaultUseCaches(false);
DateServletConnection.setRequestProperty("Content-Type","application/octet-stream");
} } catch(Exception e) { e.printStackTrace(); } |
this part is where i need to connect to servlet it goes through the system.out.print
when i on tomcat it didn't call it