Java
  Home arrow Java arrow Page 6 - Slapping Together A JSP Development Environment
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? 
Google.com  
JAVA

Slapping Together A JSP Development Environment
By: icarus, (c) Melonfire
  • Search For More Articles!
  • Disclaimer
  • Author Terms
  • Rating: starstarstarstarstar / 4
    2001-03-05


    Table of Contents:
  • Slapping Together A JSP Development Environment
  • Essential Software
  • One Tomcat, Standing Alone
  • Connecting The Dots
  • Same Story, Different OS
  • Putting It In Context
  • Making The Grade

  • 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


    Slapping Together A JSP Development Environment - Putting It In Context
    ( Page 6 of 7 )

    The default Tomcat installation comes with a folder named "webapps", which contains sample files. You can place your JSP documents here, or you can define new locations from which to serve JSP files. In Tomcat-lingo, these locations are known as "contexts", and they're defined in the "server.xml" file in the Tomcat CONF directory.

    Let's suppose that you wanted to serve files from the location http://localhost/jsp/, The first thing to do is to define a context in the Tomcat "server.xml" configuration file.

    <Context path="/jsp" docBase="webapps/jsp/" debug="0" reloadable="true"> </Context>

    This maps the location /jsp to the "webapps/jsp" folder.

    Next, create a directory named "jsp" in the "webapps" folder, place the "hello.jsp" script there, and restart Tomcat and Apache. You should see the new context when Tomcat starts up.

    Context log: path="/examples" Adding context path="/examples" docBase="webapps/examples" Context log: path="/test" Adding context path="/test" docBase="webapps/test" Context log: path="/jsp" Adding context path="/jsp" docBase="webapps/jsp/"

    Now, when you point your browser to the URL http://localhost/jsp/hello.jsp, you should see the file being rendered correctly.

    You can add as many contexts as you like, using the format above - however, these will always be one level below the server's document root. If you'd like to run JSP files from the document root itself, you should place them in the "webapps/ROOT" folder. For example, if the file "hello.jsp" was located in "webapps/ROOT", I would be able to access it via the URL http://localhost/hello.jsp.

    If you're really picky, you can define an alternate location for the root folder by creating a new context - as the following example demonstrates:

    <Context path="/" docBase="webapps/my/new/server/root" debug="0" reloadable="true" > </Context>

    For more information on contexts, and how to tweak them for maximum performance, take a look at the Tomcat User Guide at http://jakarta.apache.org/

     
     
    >>> More Java Articles          >>> More By icarus, (c) Melonfire
     

       

    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 1 Hosted by Hostway
    For more Enterprise Application Development news, visit eWeek