• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

where is servlet package

 
Ranch Hand
Posts: 133
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi, I'm very new to server side. I'm using JDK1.3 on Win98 and already set up Tomcat. I have no problem running the examples. But when I tried to use compile some of the source code in the example(of course, you already have the class files sitting there). I just want to compile myself but get a bunch of errors. It seems javax.servlet package is not included in JDK1.3. So do I need to have J2ee to develop servlets? Or there is some way out.
 
Tom Tang
Ranch Hand
Posts: 133
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I find this in one tutorial at sun's site:
Before you can invoke a servlet, you must compile it. Many vendors offer IDEs equipped with servlet wizards that make it easy to create and compile servlets almost automatically. The Guestbook servlet presented in this article was created and compiled using IBM's WebSphere Studio IDE.
Does it mean we can't compile servlet with EditPlus or TextPad? I'm still a loss when it comes to compile codes with "import javax.servlet.*" The compiler always fails to recognize this package. What am I missing here?
I would appreciate if someone can help me out.
Weiye Tang
 
Ranch Hand
Posts: 625
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
You have to either download the Servlet package and install it, or install J2EE. Somebody mentioned that it comes with TomCat, but i'm not sure.
 
Ranch Hand
Posts: 115
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Its in \tomcat\lib\servlet.jar
 
Ranch Hand
Posts: 3695
IntelliJ IDE Java Ubuntu
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
You definately can compile a servlet (and EJB's too) with TextPad, this is what I use.

The only thing you need to do is include the appropriate jar file in the classpath (in your case, servlet.jar). I've set up a custom command to do this. In TextPad, Configure|Preferences|Tools then click the Compile Java and in the Parameters, include " -classpath mypathto/servlet.jar" in front of the $File
 
Tom Tang
Ranch Hand
Posts: 133
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
One book instructed to copy servlet.jar to jdk1.3\lib\ext And then all the servlet compiles fine. But I don't know why. The ext folder is empty before copying.
 
Greenhorn
Posts: 21
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

Originally posted by Tom Tang:
One book instructed to copy servlet.jar to jdk1.3\lib\ext And then all the servlet compiles fine. But I don't know why. The ext folder is empty before copying.


Hi guys,
I'm using JRun3.0 and in case anyone else using JRun has this problem, the servlet.jar class is in the lib/ext directory.
I copied the jar file to the jdk sub directory as suggested above, but that didn't quite work for me, however I added the path to my classpath and thankfully I'm now able to compile servlets using Textpad.
Thanks for the info above guys.
 
Don't get me started about those stupid light bulbs.
reply
    Bookmark Topic Watch Topic
  • New Topic