Win a copy of Re-engineering Legacy Software this week in the Refactoring forum
or Docker in Action in the Cloud/Virtualization forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

How to compile a servlet?

 
Ls chin
Ranch Hand
Posts: 99
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi all,

I'm reading the Head First Servlet & JSP Book but I don't understand the explanations on how to compile a servlet (on page 81).

I can't follow the examples in the book because in the HF book, the tomcat is in the local computer but I'm using tomcat which is in a trial-server.

So, how do I compile my servlet which is in a trial-server?

My java file is in this directory:

/usr/local/shared/tomcat/myLoginNameHere/webapps/Beer-v1/WEB-INF/classes/com/example/web/

Thank you.
[ October 14, 2008: Message edited by: LS chin ]
 
Campbell Ritchie
Sheriff
Posts: 48415
56
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Don't know, but we have FAQ.
 
Ls chin
Ranch Hand
Posts: 99
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi Campbell, all,

I've decided to download Apache and Tomcat in my local drive. I went to the Apache Tomcat download page but it is terribly confusing!


Do I need to download a binary or source distribution?

Edit: There's also something like [PGP] [MD5] , what are these things?

Thank you.

[ October 14, 2008: Message edited by: LS chin ]
[ October 14, 2008: Message edited by: LS chin ]
 
Campbell Ritchie
Sheriff
Posts: 48415
56
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
PGP is Pretty Good Privacy and MD5 is a hashing algorithm. They are both used to verify a correct download. Don't know any more, I am afraid.
 
Ls chin
Ranch Hand
Posts: 99
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi all,

From the download FAQ page:

Packaging Details (or "What Should I Download?")
1. apache-tomcat-[version].zip or .tar.gz:
base distro, all non-embedded users download this.

2. apache-tomcat-[version].exe:
Windows installer with base distro contents + Windows installation.

3. apache-tomcat-[version]-admin.zip or .tar.gz:
the Tomcat Administration webapp only.

4. apache-tomcat-[version]-compat.zip or .tar.gz: required in addition to the base distro for using tomcat with a Java 1.4 environment.

5. apache-tomcat-[version]-deployer.zip or .tar.gz:
the standalone Tomcat Web Application Deployer.

6. apache-tomcat-[version]-embed.zip or .tar.gz:
for using Tomcat only as an embedded servlet container.

Which download link is the right one? Sorry for being persistent with this.

Thanks.
 
Ls chin
Ranch Hand
Posts: 99
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Dear all,

I found it! It's in this link: download apache tomcat

Click on the link: Core: Windows Service Installer.

Thanks.
 
Vinod K Singh
Ranch Hand
Posts: 198
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Just add jsp-api.jar and servlet-api.jar, which are available under lib directory of tomcat distribution, in your classpath while doing compilation.
 
Ls chin
Ranch Hand
Posts: 99
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Dear Vinod,

It works! Thank you, thank you, thank you.

Originally posted by Vinod K Singh:
Just add jsp-api.jar and servlet-api.jar, which are available under lib directory of tomcat distribution, in your classpath while doing compilation.


 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic