• 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 do you save a Servlet file in Tomcat 4.0

 
Ranch Hand
Posts: 39
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Where do you save the servlet file in Tomcat 4.0
and also how do you point the servlet.jar

Im using j2sdk1.4.0
 
Ranch Hand
Posts: 86
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Angelo:
You save your servlet class files under $CATALINA_HOME\webapps\yourwebappname\WEB-INF\classes
servlet.jar is under $CATALINA_HOME\common\lib folder. You can include the file path to the servlet.jar in your system CLASSPATH.
FYI:
Please refer to this URL:
Apache Jakarta Tomcat4: Configuration and Usage Tutorial
Hope this helped
[ October 29, 2002: Message edited by: Madan, Gopal ]
 
Angelo Watson
Ranch Hand
Posts: 39
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
do i create the web-inf and classes directory and also do i have to configure the server.xml or web.xml
 
Angelo Watson
Ranch Hand
Posts: 39
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
It cant find the packages javax.servlet and javax.servlet.http
This is how my autoexec.bat looks like:
SET JAVA_HOME=C:\j2sdk1.4.0_01
SET TOMCAT_HOME=C:\Tomcat
SET PATH=C:\j2sdk1.4.0_01\bin
SET PATH=%PATH%;C:\Tomcat
SET CLASSPATH=%CLASSPATH%;C:\Tomcat\common\lib\servlet.jar

Can someone tell whats wrong with it. Thank you
 
Madan, Gopal
Ranch Hand
Posts: 86
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Angelo:
First...Did you reboot your machine for the changes in AUTOEXEC.BAT to kick in.
You another option is to compile your java file using the classpath option in javac command as follows:


Yes you need to create an exploded directory structure for your webapp as follows: c:\tomcat\webapps\YOURAPPNAME.
Here you can save your html, jsp etc files.
Beneath the directory you just created, do create the following directories.
c:\tomcat\webapps\YOURAPPNAME\WEB-INF
c:\tomcat\webapps\YOURAPPNAME\WEB-INF\classes
c:\tomcat\webapps\YOURAPPNAME\WEB-INF\lib
Compile and drop your *.class file inside the WEB-INF\classes directory.
You need to create a file called web.xml under WEB-INF folder. You also need to include a Context line in your server.xml about your new web application.
If you refer to the URL i cited earlier, you should come out of this unscathed
By the way, what version of Tomcat are you using. If you just ran the executable/Unzipped the zip archive, everything should be OK
[ October 29, 2002: Message edited by: Madan, Gopal ]
 
Consider Paul's rocket mass heater.
reply
    Bookmark Topic Watch Topic
  • New Topic