Win a copy of Mesos in Action this week in the Cloud/Virtualizaton forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

how to pass the hidden form values to the URL in java?

 
Deepa Rajesh
Greenhorn
Posts: 6
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I want to get the HTML content of one webpage inside java class.The webpage is using some hidden form fields to be set for getting proper webpage.
I am using the java.net.URL class to call the webpage.

is it possible to set the hidden form fields in java itself?



Please help.
 
Ivan Jozsef Balazs
Rancher
Posts: 979
5
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hidden fields are transferred in the same way as text fields, also depending on whether the method is GET or POST.
 
William Brogden
Author and all-around good cowpoke
Rancher
Posts: 13061
6
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I am using the java.net.URL class to call the webpage.


What do you man by "call the webpage"?

Form values, hidden or not, are formatted by the BROWSER into a HTTP request (GET or POST) which gets sent to a service.

Are you are trying to emulate a browser sending FORM values?

Bill
 
Deepa Rajesh
Greenhorn
Posts: 6
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I have a client URL .I should call the URL and get the HTML Content of the page and i should process the html page content (listing the product details).

I can get the HTML Content of the page using HttpURLConnection.getContent();

But , the html content is differ if we send some hidden form fields. that is the case , i should send the form hidden field values using Java or servlet .I have only the client URL and the form name.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic