• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Liutauras Vilda
  • Jeanne Boyarsky
  • Devaka Cooray
  • Paul Clapham
Sheriffs:
  • Tim Cooke
  • Knute Snortum
  • Bear Bibeault
Saloon Keepers:
  • Ron McLeod
  • Tim Moores
  • Stephan van Hulst
  • Piet Souris
  • Ganesh Patekar
Bartenders:
  • Frits Walraven
  • Carey Brown
  • Tim Holloway

File Upload and processing

 
Ranch Hand
Posts: 82
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi...
I have the following scenario:
I need to upload a file to the server and then parse the file to create an XML. While parsing i need to do data validation check on the record and if there are errors, I need to populate the same in the XML. So XML will contain

<rec>
<field-1 err="y">
<data>abc</data>
<err-msg>abc-err</err-msg>
</field-1>
</rec>.

1) I am planning on rendering a error page by converting the XML with errors are HTML. Is this a good way of doing so? or there are better ways?


2) What is the best utility to do file Upload? I am thinking of Commons File Upload. My file size will not exceed 2-3 MB. Do anyone have servlet based code for the same?

3) What is the best way to reading and parsing the file and generate the XML? I was thinking of substring to parse and JDOM to create XML.

Please let me know if there are some things which i need to take care...

If anyone have code for above... it would be great help..

Thanks in advance...
 
Consider Paul's rocket mass heater.
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!