Quick tomcat Question . . . .

Discussion in 'OT Technology' started by DeeVoc, May 1, 2003.

  1. DeeVoc

    DeeVoc Heh.

    Joined:
    Aug 13, 2001
    Messages:
    33,124
    Likes Received:
    0
    Location:
    Brooklyn
    If one of my servlets is opening up a text file for lookup purposes where do I place the lookup file so that the class can find it during runtime execution? Thanks
     
  2. SLED

    SLED build an idiot proof device and someone else will

    Joined:
    Sep 20, 2001
    Messages:
    28,118
    Likes Received:
    0
    Location:
    AZ, like a bauce!
    i'm just going to take a wild guess here (because i don't know much about java/tomcat) but i'd say that the class would look in it's local folder for the file, unless instructed differently.
     
  3. CompiledMonkey

    CompiledMonkey New Member

    Joined:
    Oct 26, 2001
    Messages:
    8,528
    Likes Received:
    0
    Location:
    Richmond, VA
    I'm not 100%, but I believe you can load up a file from anywhere on the filesystem from a servlet. Try it and see. ;)
     
  4. SLED

    SLED build an idiot proof device and someone else will

    Joined:
    Sep 20, 2001
    Messages:
    28,118
    Likes Received:
    0
    Location:
    AZ, like a bauce!
    if you specify the path in the servlet, and have read access to it, then you can put it anywhere.

    EDIT: If you don't specify a path at all, i think it would look in it's running folder. (which is what my orriginal point was, but didn't really say it the right way :big grin: )
     
    Last edited: May 1, 2003
  5. CompiledMonkey

    CompiledMonkey New Member

    Joined:
    Oct 26, 2001
    Messages:
    8,528
    Likes Received:
    0
    Location:
    Richmond, VA
    Try C:/Tomcat/bin/ . I think that's the running folder. You would think it would be in your project somewhere. :dunno:
     
  6. DeeVoc

    DeeVoc Heh.

    Joined:
    Aug 13, 2001
    Messages:
    33,124
    Likes Received:
    0
    Location:
    Brooklyn
    :wtf:, it's reading and writing to the bin directory. I'm guessing there's some xml tags to modify it, but that's kind of an odd default.

    Edit - beat me to it :o, yeah I also figured out yesterday that tomcat must cache your class files somewhere because you have to restart tomcat everytime you recompile. It'll even keep running if you delete your class files from teh lib directory.
     

Share This Page