Java
  Home arrow Java arrow Page 10 - Developing JavaServer Pages
Dev Shed Forums 
Administration  
Apache  
BrainDump  
DHTML  
Flash  
Java  
JavaScript  
Multimedia  
MySQL  
Oracle  
Perl  
PHP  
Practices  
Python  
Reviews  
Security  
Style-Sheets  
Web Services  
XML  
Zend  
Zope  
Forums Sitemap 
IBM® developerWorks 
Dedicated Servers 
E-Commerce Hosting 
Linux Web Hosting 
Managed Hosting 
Small Business Hosting 
Download TestComplete 
VPS Hosting 
Weekly Newsletter

 
Developer Updates  
Free Website Content 
IBM Developerworks
 RSS  Articles
 RSS  Forums
 RSS  All Feeds
Write For Us Get Paid 
Request Media Kit
Contact Us 
Site Map 
Privacy Policy 
Support 
 USERNAME
 
 PASSWORD
 
 
  >>> SIGN UP!  
  Lost Password? 
JAVA

Developing JavaServer Pages
By: Joel Murach
  • Search For More Articles!
  • Disclaimer
  • Author Terms
  • Rating: 4 stars4 stars4 stars4 stars4 stars / 61
    2004-05-12

    Table of Contents:
  • Developing JavaServer Pages
  • The Code for the HTML Page that Calls the JSP
  • Imitating HTML
  • How to Create a JSP
  • How to Use the Methods of the Request Object
  • Retrieving Multiple Values
  • How to Request a JSP
  • Using Get and Post Methods
  • Using the Post Method
  • Managing Java Classes
  • Class Location

  • Rate this Article: Poor Best 
      ADD THIS ARTICLE TO:
      Del.ici.ous Digg
      Blink Simpy
      Google Spurl
      Y! MyWeb Furl
    Email Me Similar Content When Posted
    Add Developer Shed Article Feed To Your Site
    Email Article To Friend
    Print Version Of Article
    PDF Version Of Article
     
     
     
    ADVERTISEMENT

    Stay one step ahead of the competition. Evaluate and give feedback on some of the hottest web development tools on the market today. Make your opinion heard! Click Here

    Developing JavaServer Pages - Managing Java Classes
    (Page 10 of 11 )

    If you're using Tomcat 4.0, Figure 10 shows where and how to save your compiled Java classes (the .class files) so Tomcat can access them. Usually, you'll save your source code (the .java files) in the same directory, but that's not required.

    Figure 10: Where and How to Save and Compile Regular Java Classes

    Where the User class is saved

    c:tomcatwebappsmurachWEB-INFclassesbusiness

    Where the UserIO class is saved

    c:tomcatwebappsmurachWEB-INFclassesdata

    Other places to save your Java classes

    c:tomcatwebappsyourDocumentRootWEB-INFclasses
    c:tomcatwebappsyourDocumentRootWEB-INFclassespackageName
    c:tomcatwebappsROOTWEB-INFclasses
    c:tomcatwebappsROOTWEB-INFclassespackageName

    The DOS Prompt Window for Compiling the User Class

    Command Prompt

    Description

    Although you can save the source code (the .java files) in any directory, you must save the class files (the .class files) in the WEB-INFclasses directory or one of its subdirectories. This can be subordinate to the ROOT directory or your own document root directory.

    To compile a class, you can use TextPad's Compile Java command, your IDE's compile command, or the javac command from the DOS prompt window.

    If you have trouble compiling a class, make sure your system is configured correctly as described in appendix A of my textbook.

    The two paths shown at the top of this figure show where the User and UserIO classes that come with this book are saved. After that, the figure presents the syntax for other paths that can be used to store Java classes. If you review these paths, you'll see that each one places the Java classes in a subdirectory of the WEB-INFclasses directory. 

    Remember: this is from chapter four of Joel Murach's Java Servlets and JSP (Mike Murach & Associates, ISBN 1890774189, 2003). Grab a copy at your favorite book store today!

     Buy this book now.

    More Java Articles
    More By Joel Murach


     

       

    JAVA ARTICLES

    - The Spring Framework: Understanding IoC
    - Introducing the Spring Framework
    - Java Classes
    - Completing the Syntactic Comparison of Java ...
    - Syntactic Comparison of Java and C/C++
    - Java Statements
    - Conditionals, Expressions and Other Java Ope...
    - Java Operators
    - Primitive Data Types and Basic Language Rule...
    - Java and Object-Oriented Programming
    - Java Beginning Programming
    - Gaming Development Setup
    - Using RPC-Style Web Services with J2EE
    - Integrating XML with J2EE
    - Taming Tiger: Concurrent Collections




    © 2003-2008 by Developer Shed. All rights reserved. DS Cluster 2 hosted by Hostway