Welcome to the MacNN Forums.

If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

You are here: MacNN Forums > Software - Troubleshooting and Discussion > Developer Center > servlet confusion . . .

servlet confusion . . .
Thread Tools
Fresh-Faced Recruit
Join Date: Jul 2002
Status: Offline
Reply With Quote
Feb 10, 2004, 07:57 PM
 
Hey there, I'm looking for help from any java experts, or perhaps pointers to other relevant forums. I'm trying to compile a java servlet, and then I'm going to upload it to another server where it's actually going to be run. I just need to be able to modify the code and compile it. Unfortunately, when I try to compile it under OSX, it runs into problems because it can't important javax.*

Some searching under google reveals more questions than answers, apparently this servlet library is not part of the default installation of Java, and it seems to relate to something called Tomcat. However, that doesn't particularly help me...I can't figure out how to download it, and where to put it in order to use it.

Anyone have any suggestions?

-prokrast
     
Mac Elite
Join Date: Dec 2001
Location: Atlanta, GA, USA
Status: Offline
Reply With Quote
Feb 10, 2004, 08:40 PM
 
Originally posted by prokrast:

I just need to be able to modify the code and compile it. Unfortunately, when I try to compile it under OSX, it runs into problems because it can't important javax.*

Some searching under google reveals more questions than answers, apparently this servlet library is not part of the default installation of Java, and it seems to relate to something called Tomcat. However, that doesn't particularly help me...I can't figure out how to download it, and where to put it in order to use it.
Servlets are part of the javax.servlet package. This package is not part of the standard java. You can get it from any java servlet container, including Tomcat.

Tomcat is an open source java app server container. You can download it here:

http://jakarta.apache.org/tomcat/

Once you have it, you need the servlet.jar file in common/lib/ inside the Tomcat folder. Put that file in your classpath and you should be good.
Mac Pro 2x 2.66 GHz Dual core, Apple TV 160GB, two Windows XP PCs
     
Forum Regular
Join Date: Nov 2002
Location: PVD/MSP
Status: Offline
Reply With Quote
Feb 11, 2004, 09:24 AM
 
If you're running Panther, you can install an Apple package that will add dev support for servlets. The package is ApplicationsServerDev.pkg and can usually be found in /Applications/Installers/Developer Tools/Packages

Note: After you do this, you will have a basic tomcat and Jboss installation at /Library/Tomcat and /Library/JBoss if you want to learn more about servlets servers.
dearinter.net consensus life coaching.
     
Professional Poster
Join Date: Oct 2001
Location: London
Status: Offline
Reply With Quote
Feb 11, 2004, 09:41 AM
 
Does This help?
     
Senior User
Join Date: Oct 2000
Location: Lawrence, KS
Status: Offline
Reply With Quote
Feb 11, 2004, 10:37 AM
 
You could always compile your servlets by just putting the correct jar file on your classpath. However, you will not be able to run/test your work unless you install/configure/deploy your servlet in a servlet container.

Servlets need to run in their own dedicated environment (this the concept of a container). Tomcat provides that environment for you. There are a few others but Tomcat is the most popular one.

The link that Diggory provides has all you need to get you going. Java development is a fairly pleasant experience in OSX. Enjoy!
iMac 17" G4 800MHZ & 768 SDRAM
     
Fresh-Faced Recruit
Join Date: Jul 2002
Status: Offline
Reply With Quote
Feb 11, 2004, 11:23 AM
 
Thanks for the help everyone, I was able to figure it all out and get it to compile. The Apple link was especially helpful . . .
     
   
Thread Tools
Forum Links
Forum Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts
BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On
Top
Privacy Policy
All times are GMT -5. The time now is 12:58 PM.
All contents of these forums © 1995-2011 MacNN. All rights reserved.
Branding + Design: www.gesamtbild.com
vBulletin v.3.8.7 © 2000-2011, Jelsoft Enterprises Ltd., Content Relevant URLs by vBSEO 3.3.2