#1
  1. No Profile Picture
    Junior Member
    Devshed Newbie (0 - 499 posts)

    Join Date
    Dec 2002
    Location
    Los Angeles
    Posts
    2
    Rep Power
    0

    problem with FileNotFoundError on my servlet


    This problem is really frustrating me. I have a servlet that reads in a file for that it uses as a html template for the webpage. This code worked, and just stopped working all of a sudden. I get this when I try to run the servlet

    'java.io.FileNotFoundException: main.tpl'

    My code is just:

    BufferedReader templateFile = new BufferedReader(new FileReader(main.tpl));

    I've also tried using '../images/main.tpl'
    So how should I write open the file and where should I put it? Is there anything else that could cause this problem? Thanks in advance.

    Oh, I'm using tomcat.
  2. #2
  3. dont click here
    Devshed Newbie (0 - 499 posts)

    Join Date
    Jun 2002
    Posts
    409
    Rep Power
    13
    u might need to use the absolute URL
  4. #3
  5. No Profile Picture
    Junior Member
    Devshed Newbie (0 - 499 posts)

    Join Date
    Dec 2002
    Location
    Los Angeles
    Posts
    2
    Rep Power
    0

    problem with FileNotFoundError on my servlet


    I thought about that, but I don't want to do it that way for various reasons. I figured out the problem yesterday, but it seems a little weird. I had the servlet create a file and then I looked to see where that file was created. It's in ~/bin
    Doesn't that seem weird?

IMN logo majestic logo threadwatch logo seochat tools logo