File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
The moose likes Sockets and Internet Protocols and the fly likes Question about posting..... urgent.... Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » Sockets and Internet Protocols
Bookmark "Question about posting..... urgent.... " Watch "Question about posting..... urgent.... " New topic
Author

Question about posting..... urgent....

Harry Singh
Ranch Hand

Joined: May 02, 2001
Posts: 124
Hi,
I have to make a make a connection to a URL and get the HTML data from that... i can do this using URL conection and now after this i have to post the data i.e in text box & other data to that URL as well.. Can anyone please tell me how can i do this.. can i post data through URLConnection or i do have to make a socket and then write data. can anyone paste a skeleon code here so that i can have an idea as i am newbie in this world.
Regards,
Harry
Torsten Schippel
Ranch Hand

Joined: May 09, 2003
Posts: 62
Hi Harjinder,
you may use HTTPURLConnection class.

HTH
Torsten
Harry Singh
Ranch Hand

Joined: May 02, 2001
Posts: 124
Hi,
But the page that i am trying to post is actually a HTML page so i guess i cant use this Method of directly posting to HTML page... Is there any way i can POSt to a HTML page.. basically i wanna have my own HTMl page which will hide the HTML page that i wanna post to.. so in my HTML page the user will type in some data and on action, i wanna use the same action that the third party HTML page is doing.. can this be done?
Thanks in advance
Torsten Schippel
Ranch Hand

Joined: May 09, 2003
Posts: 62
Hi Harjinder,
I'm not sure I got you right.
But the page that i am trying to post is actually a HTML page so i guess i cant use this Method of directly posting to HTML page...
You never post a HTML page. You get it back only. If you do a submit on any page you only submit the form data of the associated form. So like in the source it's enough to send just the parameters.
Is there any way i can POSt to a HTML page..
basically i wanna have my own HTMl page which will hide the HTML page that i wanna post to.. so in my HTML page the user will type in some data and on action, i wanna use the same action that the third party HTML page is doing.. can this be done?

If you only want to send your data to the third party page. And you would like to login there probably then it's enough if you analyze the original third party page (form, field and action names) then copy this into your design and set the right URL (third party).
If you like to process any of the information then use a servlet as target of your page (form) read the parameters and send it to the third party page as shown in the source. Read the response and write it to the servlet response output.
Hope I understood you.
Regards
Torsten
 
It is sorta covered in the JavaRanch Style Guide.
 
subject: Question about posting..... urgent....
 
Similar Threads
Your opinion on my newbie Webapp Architecture
Reading Post Data in a jsp thorugh a URL
Application Times Out
Frames in HTML
Post data.