I have just created a servlet that is supposed to write a file to disk, but
I am now getting this Resource not allowed error. Does anyone know what
might be wrong? Below is the code in my servlet.

import java.io.*;
import java.util.*;
import javax.servlet.*;
import javax.servlet.http.*;

public class XmlPdf extends HttpServlet {

  public void init(ServletConfig conf) throws ServletException {
    super.init(conf);
  }

  public void doPost (HttpServletRequest req, HttpServletResponse res)
      throws ServletException, IOException {
   String fileName = "something_random.xml";
    File file = new File(fileName);

    System.out.println("Creating "+fileName);

    FileOutputStream fout = new FileOutputStream(file);
    PrintWriter out = new PrintWriter(fout);

    out.println("Sometimes you have to do things to save your neck");
    out.println();
    out.println("This is one of those times");
    out.println();
    out.close();
  }
}

Thanks,

Aaron

                <<:::..:::...::: Aaron Prohaska :::..:::...:::>>
VerdeSoft Internet Services
mailto:[EMAIL PROTECTED]          http://www.verdesoft.net/

===========================================================================
To unsubscribe: mailto [EMAIL PROTECTED] with body: "signoff JSP-INTEREST".
Some relevant FAQs on JSP/Servlets can be found at:

 http://java.sun.com/products/jsp/faq.html
 http://www.esperanto.org.nz/jsp/jspfaq.html
 http://www.jguru.com/jguru/faq/faqpage.jsp?name=JSP
 http://www.jguru.com/jguru/faq/faqpage.jsp?name=Servlets

Reply via email to