4

Where do I have to put my *.class file in Tomcat Directory?

In my Java-Complete Reference book, they told to put it in C:\Program Files\Apache Tomcat 4.0\webapps\examples\WEB-INF\classes. But now i'm using Tomcat 7.0. There is no folder exists with the name "examples" in webapps.

How can I fix this? Can you tell me links that will illustrate Servlets from beginning?

2
  • have you actually compiled anything? and are you using an IDE?
    – Richard H
    Aug 4, 2010 at 11:47
  • i just typed the code from the book and compiled in cmd prompt.
    – user405398
    Aug 4, 2010 at 13:01

1 Answer 1

8

Just create one yourself. Any folder which you create in Tomcat/webapps will become a standalone webapplication. You don't even need to name it explicitly /examples. You can even name it /beer. You then just have to change the URL from http://localhost:8080/examples to http://localhost:8080/beer.


That said, I think it's better to look for a more recent book than the one mentioning Tomcat 4.0 which is already over a decade old. There might be more old fashioned advices/practices in the book which really can't be done anymore nowadays (for example, cough, scriptlets). Those books are more recent (in order from newest to older):

To learn JSP/Servlets online, I can recommend the tutorials and ebook at coreservlets.com:

See also:

1
  • 8
    +1 I actually like the webapp named beer. If only it served up the appropriate response.
    – JoseK
    Aug 4, 2010 at 12:07

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.