aspose file tools*
The moose likes Tomcat and the fly likes Error loading file Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Spring in Action this week in the Spring forum!
JavaRanch » Java Forums » Products » Tomcat
Bookmark "Error loading file" Watch "Error loading file" New topic
Author

Error loading file

Svend Rost
Ranch Hand

Joined: Oct 23, 2002
Posts: 904
Hi,

I'd like to load a file from my Servlet and read it's contens, but
I get an "Error loading file" when the code is run.

Where should I place the file ?

My servlet class file lies in: Tomcat/webapps/examples/WEB-INF/classes/
where the file also lies. I contact the Servlet via the following URL:
http://localhost:8080/examples/servlet/<servletname>

Thanks in advance,

/Svend Rost
Ben Souther
Sheriff

Joined: Dec 11, 2004
Posts: 13410

Look up ServletContext.getResource or ServletContext.getResourceAsStream.


Java API J2EE API Servlet Spec JSP Spec How to ask a question... Simple Servlet Examples jsonf
William Brogden
Author and all-around good cowpoke
Rancher

Joined: Mar 22, 2000
Posts: 12806
    
    5
Your use of /servlet/ in the URL indicates you may be getting tangled up in the "invoker" servlet conventions. Read this FAQ on the invoker here at the ranch.
Bill
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Error loading file