File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
A friendly place for programming greenhorns!
Big Moose Saloon
Register / Login
Win a copy of
REST with Spring (video course)
this week in the
Access xml from servlet
Joined: Feb 09, 2006
Jul 24, 2006 17:16:00
Can anyone tell me or point me in the direction on how to access an xml file that is on the webb from my
. After I get the xml, I will create a file in the local directory.
Author and ninkuma
Joined: Jan 10, 2002
Jul 24, 2006 18:11:00
Could you be more specific about "on the webb [sic]"?
Asking smart questions
Books by Bear
Joined: Apr 25, 2005
Jul 24, 2006 18:38:00
Well if you want to read the xml file from
more precisely want to map xml file to java object, then you need certain parsers like dom or sax parser. You can try dom4j or digester for that.
Asking Smart Questions FAQ
How To Put Your Code In Code Tags
Joined: Feb 11, 2006
Jul 24, 2006 23:45:00
//read the file // Set the headers. res.setContentType("application/x-download"); res.setHeader("Content-Disposition", "attachment; filename=" + filename); // Send the file. OutputStream out = res.getOutputStream( ); writeFileToOutput(filename, out);
[ July 24, 2006: Message edited by: ak pillai ]
java j2ee job interview questions with answers
Learn the core concepts and the key areas
I agree. Here's the link:
subject: Access xml from servlet
Error reading non servlet data from a jsp
Issue w/ accesing file from a Servlet
importing an xml file and use xml file data
Why can't servlets access a file with a relative path
All times are in JavaRanch time: GMT-6 in summer, GMT-7 in winter
| Powered by
Copyright © 1998-2015