aspose file tools*
The moose likes Beginning Java and the fly likes How to compile a servlet? 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 » Java » Beginning Java
Bookmark "How to compile a servlet?" Watch "How to compile a servlet?" New topic
Author

How to compile a servlet?

Ls chin
Ranch Hand

Joined: Jun 28, 2008
Posts: 99
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

Joined: Oct 13, 2005
Posts: 39409
    
  28
Don't know, but we have FAQ.
Ls chin
Ranch Hand

Joined: Jun 28, 2008
Posts: 99
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

Joined: Oct 13, 2005
Posts: 39409
    
  28
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

Joined: Jun 28, 2008
Posts: 99
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

Joined: Jun 28, 2008
Posts: 99
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

Joined: Sep 30, 2008
Posts: 198
Just add jsp-api.jar and servlet-api.jar, which are available under lib directory of tomcat distribution, in your classpath while doing compilation.


My Blog
Ls chin
Ranch Hand

Joined: Jun 28, 2008
Posts: 99
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.


 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: How to compile a servlet?