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

 
Developer Updates  
Free Website Content 
 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: starstarstarstarstar / 64
    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:
      error-file:tidyout.log Del.ici.ous error-file:tidyout.log Digg
      error-file:tidyout.log Blink error-file:tidyout.log Simpy
      error-file:tidyout.log Google error-file:tidyout.log Spurl
      error-file:tidyout.log Y! MyWeb error-file:tidyout.log 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


    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

    - Exception Handling Techniques in Java
    - More About Multithreading in Java
    - The Basics of Multiple Threads in Java
    - Data Access Using Spring Framework JDBC
    - New Object Initialization in Java
    - Adding Images With iTextSharp
    - Adding Columns With iTextSharp
    - Creating Simple PDF Files With iTextSharp
    - 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...





    © 2003-2009 by Developer Shed. All rights reserved. DS Cluster 4 Hosted by Hostway
    Stay green...Green IT