• Post Reply Bookmark Topic Watch Topic
  • New Topic

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

 
Greenhorn
Posts: 1
  • 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?
 
Ranch Hand
Posts: 234
  • 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.


 
Creator of Enthuware JWS+ V6
Saloon Keeper
Posts: 3064
248
Android Chrome Eclipse IDE
  • 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
     
    Bartender
    Posts: 4012
    42
    Chrome Fedora Hibernate
    • 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.
     
    • Post Reply Bookmark Topic Watch Topic
    • New Topic
    Boost this thread!