|
|
|
| |||||||||
![]() |
|
|
«
Previous Thread
|
Next Thread
»
|
Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
#1
|
|||
|
|||
|
Server Side form submission
I need to submit a form from the server not the client's browser, any suggestions. Thank You
![]() |
|
#2
|
|||
|
|||
|
Yep,
For example, assuming you mean an HTML POST to a servlet, then it'd be something like the following HttpURLConnection con = (HttpURLConnection)new URL("localhost/servlet/TestServlet"); con.setRequestMethod("POST"); con.setRequestProperty("Content-type", "text/html"); con.setDoOutput(true); con.setDoInput(true);//If you want to process the reponse OutputStream out = con.getOutputStream(); Then you send all your stuff to the stream, and when you close the output stream it should complete the POST hope that's of some help |
![]() |
| Viewing: Dev Shed Forums > Programming Languages > Java Help > Server Side form submission |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|
|
|