aspose file tools*
The moose likes Web Component Certification (SCWCD/OCPJWCD) and the fly likes Question about path on Head First JSP and Servlets for SCWCD 1.4, page 81 Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of The Java EE 7 Tutorial Volume 1 or Volume 2 this week in the Java EE forum
or jQuery UI in Action in the JavaScript forum!
JavaRanch » Java Forums » Certification » Web Component Certification (SCWCD/OCPJWCD)
Bookmark "Question about path on Head First JSP and Servlets for SCWCD 1.4, page 81" Watch "Question about path on Head First JSP and Servlets for SCWCD 1.4, page 81" New topic
Author

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

Antonio Rueda Toicent
Greenhorn

Joined: Sep 05, 2008
Posts: 1
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

Joined: Oct 11, 2009
Posts: 234
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
Bartender

Joined: Apr 07, 2010
Posts: 1661
    
  25

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

    Joined: Mar 24, 2008
    Posts: 3825

    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.

    SCJP 5 | SCWCD 5
    [How to ask questions] [Twitter]
     
    I agree. Here's the link: http://aspose.com/file-tools
     
    subject: Question about path on Head First JSP and Servlets for SCWCD 1.4, page 81