Is this right .. How to call the servlet by java application
//program related to calling a servlet by java standalone application and printing the response on console
import java.io.*;
import java.util.*;
import java.lang.Object;
import java.net.*;
publicclass Program
{
publicstaticvoid main(String s[])
{
System.out.println("Hello this programm defines about how to call a servlet with a java application ");
try{
URL servlet =new URL("http://192.168.11.52:8080/anchor/studentform.html");
URLConnection conn=servlet.openConnection();
conn.setDoOutput(true);
InputStreamReader isr=new InputStreamReader(conn.getInputStream());
BufferedReader br =new BufferedReader(isr);
String str ;
while((str=br.readLine())!=null)
System.out.println(str);
}
catch(IOException e)
{
System.out.println("exception is" +e);
}
}
}

