hi ranchers, i am trying to make a frame communicate with a servelt.i have 2 buttons in my frame,what i want is that when i press the first button then the frame should talk to the servlet and the servlet should execute its doGet method and pass a vector containing some values to the frame..THIS PART WORKS FINE AND THE FRAME DOES GET THE VECTOR,I HAVE CHECKED IT..but what i want is that when the user clicks the second button then the frmae should pass a vector to the servlet and servlet should read the vector using its doPost method.BUT THIS IS THE PART THAT IS NOT WORKING..basically as i have understood from running the program,the doPost method never gets executed..why is this so?i mean how can i make sure that on the click of a certain button in the frame the doPost of servlet gets executed?please helpp..its urgent..i would appreciate your help.. regards karan
William Brogden
Author and all-around good cowpoke
Rancher
Joined: Mar 22, 2000
Posts: 12271
1
posted
0
Since you don't give any code, it is hard to say. However - in order to make a URLConnection do a POST request, you have to use a method that is in the HttpURLConnection class. It turns out that if you create a URL using "http://whatever" what you get with openConnection is really HttpURLConnection hc = (HttpURLConnection)url.openConnection(); And (this is the important part) you can then: hc.setRequestMethod("POST"); Which should result in a request going to doPost Bill
hi william, i have mailed u the java files corresponding to my problem at the email given in your profile here..please take a look at it and advice me about the solution,i would appreciate it. regards karan
I agree. Here's the link: http://ej-technologies/jprofiler - if it wasn't for jprofiler, we would need to
run our stuff on 16 servers instead of 3.