Hi,
I have a servlet that connects to a database, reads it and then creates a
well formed xml file out of it. Now I have to give users the option of being
able to download the stuff if they want.
The following code works fine for most of the cases but xml files
import javax.servlet.http.*;
import javax.servlet.*;
import java.io.*;
public class content extends HttpServlet
{
public void doPost ( HttpServletRequest request, HttpServletResponse
response )
throws IOException
{
response.setHeader ( "content-disposition",
"attachment;filename=test.txt" ) ;
PrintWriter out = response.getWriter () ;
out.println ("<partha></partha>" ) ;
out.close();
}
}
This works fine till the name of the file is test.txt but the moment I make
it test.xml it gets into some kind of loop and does not download. However
one can still view it.
As you can see it is a valid xml file and the same code works for all kinds
of files but xml.
Could anybody out there help? I need it .
brgds
partha
___________________________________________________________________________
To unsubscribe, send email to [EMAIL PROTECTED] and include in the body
of the message "signoff SERVLET-INTEREST".
Archives: http://archives.java.sun.com/archives/servlet-interest.html
Resources: http://java.sun.com/products/servlet/external-resources.html
LISTSERV Help: http://www.lsoft.com/manuals/user/user.html