• Post Reply Bookmark Topic Watch Topic
  • New Topic

How to read a html form through a java program and write the string recieved into xml  RSS feed

 
Mehek Sudhakaran
Greenhorn
Posts: 4
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi.. I need to know how can i read the values from a HTML page using a java program. I need my java program to hold these values read from the page and pass it on to an XML file which in read these string of values and display them after breaking them.
For Eg:
i have an html form which takes input as:

Name: July
Age:34
Gender: F

I want my java program to read this html form and form a string which is similar to : July34F and pass this string to an XML file which in turn will display the content as and store the same:

Name: July
Age:34
Gender: F

Any suggestions...?

 
rastogi payam
Ranch Hand
Posts: 47
Chrome Eclipse IDE Tomcat Server
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
you may need to download JTidy.jar
Hope, this may help you...
This program will straight away convert your html file to Xml, eliminating the need of creating a intermediate string
 
Mehek Sudhakaran
Greenhorn
Posts: 4
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thanks for the reply... but I am unable to download the JTidy.jar...Only snapshots are available in sourceforge.net..
 
rastogi payam
Ranch Hand
Posts: 47
Chrome Eclipse IDE Tomcat Server
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Follow this link
 
Mehek Sudhakaran
Greenhorn
Posts: 4
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thankyou.. but this site is blocked at my workplace... Is there any other site i can get the download from?
 
Swastik Dey
Rancher
Posts: 1815
15
Android Eclipse IDE Java Java ME
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
As per my understanding, the mentioned library will simply convert html to xml. But the probably requirement is something else. A html page opens, user clicks on submit and the other processing start. Correct me if I am wrong.
 
Mehek Sudhakaran
Greenhorn
Posts: 4
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi Swastik..
I need to form a string out of the inputs that i recieve from the html page n then split them again into an xml page..
I am not sure baout the above code since i havn't tried the same yet.
 
Swastik Dey
Rancher
Posts: 1815
15
Android Eclipse IDE Java Java ME
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
So the very first step is to receive the submitted data, and as much as I understand for this you need some server side scripting like servlet/jsp.
 
Tim Moores
Saloon Keeper
Posts: 4032
94
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I'd use a library like HtmlUnit or jWebUnit for this.
 
It is sorta covered in the JavaRanch Style Guide.
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!