• 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

Question about path on Head First JSP and Servlets for SCWCD 1.4, page 81

 
Greenhorn
Posts: 1
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
on page 81, Bert writes:



And says that everything til tomcat should be changed based on the user's own directory path. Thing is I never defined common/lib on my structure and I don't quite understand what he's trying to do here, in this chapter a common folder is never created. I'm currently using ubuntu 9 with tomcat 6, what would my path be?
 
Ranch Hand
Posts: 234
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi Antonio,

Welcome to Java Ranch.



Maybe it should be like this:


or this:



You need to write a classpath for javac to 'servlet-api.jar'. It is part of a Tomcats Directory Structure.


 
Creator of Enthuware JWS+ V6
Posts: 3411
320
Android Eclipse IDE Chrome
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi Antonio,

and I don't quite understand what he's trying to do here


In order to run the BeerSelect example you have to compile the BeerSelect class. The BeerSelect class uses J2EE classes (like HttpServlet) which come with Tomcat and are somewhere in the Tomcat directory structure packaged inside the servlet-api.jar file.

The -classpath points to 3 directories:
  • current dir
  • classes dir
  • servlet-api.jar

  • so in order to compile your BeerSelect class you have to point to the servlet-api.jar on your system.
    Regards,
    Frits
     
    Bartender
    Posts: 4116
    72
    Mac TypeScript Chrome Java Linux
    • Mark post as helpful
    • send pies
      Number of slices to send:
      Optional 'thank-you' note:
    • Quote
    • Report post to moderator

    Antonio Rueda Toicent wrote:And says that everything til tomcat should be changed based on the user's own directory path. Thing is I never defined common/lib on my structure and I don't quite understand what he's trying to do here,...


    It says that after the "tomcat" part it's same, no difference since it is inside the Tomcat home directory. But with Tomcat 6 "lib" directory is directly inside the Tomcat home directory not in the "common" directory. If you are using Tomcat 5 you shouldn't have any problem with the given path.
     
    Consider Paul's rocket mass heater.
    reply
      Bookmark Topic Watch Topic
    • New Topic