File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
The moose likes Beginning Java and the fly likes HTML form created by Java Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » Beginning Java
Bookmark "HTML form created by Java" Watch "HTML form created by Java" New topic

HTML form created by Java

Sandy Schneider

Joined: Mar 14, 2002
Posts: 22
I have posted about this project a couple of days ago. I am a beginner with Java a need to do a project that needs to connect to a web site, post a HTML form to a URL, and get back some information.
If the documentation tells you that a HTML form needs to be sent up and the only way I can do this is to create the HTML form created by Java. Will the web server that is requesting the HTML form be able to process the Java created HTML form the same way. I am not quite sure how the process is handled.
James Swan
Ranch Hand

Joined: Jun 26, 2001
Posts: 403
Here's a link that will give you a good background on HTTP.
Also, you will need to know which parameters (ie parameter names) that the service you will be calling expects (Is there an existing HTML form page setup?, if so then you can just look at the HTML source to see which parameters are required).
Here is some code which can form a outline of what you will be doing:

Currently this code does a HTTP GET request (you will understand this after reading the above link) to, and then reads back the HTTP response from google's webserver, ie the HTML that makes up googles default search interface.
Also, commented out in the code, is an example on how to do an HTTP POST as well.
Anway, I think that covers most of what you need to achieve for your project.
Good luck.
Sandy Schneider

Joined: Mar 14, 2002
Posts: 22
Thanks James,
I can't begin to tell you how much I appreciate this information.
I agree. Here's the link:
subject: HTML form created by Java
It's not a secret anymore!