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]
# 1
URL url = new URL(" http://"+ip+":"+port+"/ A B C");it should send A, B and C three different strings to the HTTP servertake careArif
Jubaera at 2007-7-9 6:00:30 > top of Java-index,Core,Core APIs...
# 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..

12345789a at 2007-7-9 6:00:30 > top of Java-index,Core,Core APIs...
# 3
You don't write the cmd again to the URLConnection which you have already created out of the cmd: that happens implicitly when you do the POST or GET. Which is it supposed to be?
ejpa at 2007-7-9 6:00:30 > top of Java-index,Core,Core APIs...
# 4
i know but did not works socan u tell me what should i do to acheive this task....
12345789a at 2007-7-9 6:00:30 > top of Java-index,Core,Core APIs...
# 5
> i know but did not works soEh?
ejpa at 2007-7-9 6:00:30 > top of Java-index,Core,Core APIs...