Re: Applets using URL and URL Connection for HTTP Tunneling
Posted By:
Javier_Caro
Posted On:
Thursday, April 26, 2001 09:06 AM
Hi Annapurna. I've resolved this problem.
This is the source:
URL url=null;
try{
url=new URL(getCodeBase(),"servlet/unchat.ServletChat");
System.out.println("Se conecta al servlet "+url.getFile());
}catch(Exception ex){
System.out.println("Excepcion al crear URL");
}
URLConnection connection=null;
try{
connection=url.openConnection();
connection.setDoOutput(true);
}catch(IOException ex){
System.out.println("Excepcion CONECTANDO");
}
try{
PrintWriter out = new PrintWriter(connection.getOutputStream());
out.println("string=" + textMensajes.getText());
out.close();
}catch(Exception ex){
ex.printStackTrace();
}
You have to send a name of a parameter and the value of the parameter