File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
The moose likes Servlets and the fly likes frame to servlet communication.. Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login

Win a copy of Elasticsearch in Action this week in the Big Data forum!
JavaRanch » Java Forums » Java » Servlets
Bookmark "frame to servlet communication.." Watch "frame to servlet communication.." New topic

frame to servlet communication..

karan, chopra
Ranch Hand

Joined: Jun 05, 2001
Posts: 115
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..
William Brogden
Author and all-around good cowpoke

Joined: Mar 22, 2000
Posts: 12891
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:
Which should result in a request going to doPost
karan, chopra
Ranch Hand

Joined: Jun 05, 2001
Posts: 115
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.
With a little knowledge, a cast iron skillet is non-stick and lasts a lifetime.
subject: frame to servlet communication..