Sending data to server
hi
i want to send some data to the server using URLConnection
i am using it as
try{
String cmd = "http:/atieq:8080/CMSServer/PushDiscoveryServer?pushVal="
"[00-16-76-8B-85-D6*192.168.0.29*atieq*atieq*Blade*5.0*";
URL discoverdURL=new URL(cmd);
URLConnection urlconn = discoverdURL.openConnection();
--CMSServer is the project name and
--PushDiscoveryServer is HttpServlet
--pushVal is the parameter
is it possible to do this...?
or i should do smomething else .. if anyone have some idea about it plz tell me
thanks in advance
[615 byte] By [
12345789a] at [2007-11-26 18:26:26]

# 2
public class PerlTesting {
public static void main(String[] args) {
CreateThread t = new CreateThread();
t.start();
}
}
class CreateThread extends Thread
{
static int i= 0;
public void run()
{
Timer objTimer = new Timer();
objTimer.scheduleAtFixedRate(new TimerTask(){
public void run()
{
try{
String cmd = "http://atieq:8080/CMSServer/PushDiscoveryServer?pushVal="
+"00-16-76-8B-85-D6*192.168.0.29*atieq*atieq*Blade*5.0*"+
"Windows:Microsoft Windows XP ";
URL discoverdURL=new URL(cmd);
URLConnection urlconn = discoverdURL.openConnection();
ByteArrayOutputStream byteOut = new ByteArrayOutputStream();
DataOutputStream dataOut = new DataOutputStream(byteOut);
dataOut.writeBytes(cmd);
dataOut.flush();
dataOut.close();
// System.out.println(cmd);
}
catch(Exception e){
e.printStackTrace();
}
}
},0,1000); // timertask
} // thread's run
} // CreateThread
this is the code i want to send data to server after scheduled interval
i creates a schedule in a thread. this url is correctly send data to server when i use it in a browser. but not in this class...
this schedule is created and work properly but does not send data to server side servlet
what should i do..