This week's book giveaway is in the Clojure forum.
We're giving away four copies of Clojure in Action and have Amit Rathore and Francis Avila on-line!
See this thread for details.
Win a copy of Clojure in Action this week in the Clojure forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

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

 
Antonio Rueda Toicent
Greenhorn
Posts: 1
  • 0
  • Mark post as helpful
  • send pies
  • 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?
 
Petar Thomas
Ranch Hand
Posts: 234
  • 0
  • Mark post as helpful
  • send pies
  • 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.


 
Frits Walraven
Creator of Enthuware JWS+ V6
Saloon Keeper
Pie
Posts: 2167
57
Android Chrome Eclipse IDE
  • 0
  • Mark post as helpful
  • send pies
  • 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
     
    Vijitha Kumara
    Bartender
    Posts: 3908
    9
    Chrome Fedora Hibernate
    • 0
    • Mark post as helpful
    • send pies
    • 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.
     
    I agree. Here's the link: http://aspose.com/file-tools
    • Post Reply
    • Bookmark Topic Watch Topic
    • New Topic