Java
  Home arrow Java arrow Page 4 - 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 - Connecting The Dots
    ( Page 4 of 7 )

    In order to get Apache and Tomcat working together, you need to load the JServ Apache module. Under Windows, this module is currently named "ApacheModuleJServ.dll", and you need to place it in the C:\PROGRAM FILES\APACHE GROUP\APACHE\MODULES\ directory. Next, open up your "httpd.conf" file, and add the following line to the "DSO Support" section:

    LoadModule jserv_module modules/ApacheModuleJServ.dll

    This loads the JServ module into memory.

    And then add the following line to the end of "httpd.conf":

    Include "c:/tomcat/conf/tomcat-apache.conf"

    Each time Tomcat starts, it automatically creates a configuration file for Apache, customized to your system - this file is named "tomcat-apache.conf", and is stored in the Tomcat CONF\ directory. This file contains JServ settings specific to Tomcat, together with directives designed to help Apache deal with JSP files, and is essential to getting Tomcat and Apache working together.

    If Apache is running, you'll need to stop and restart it for the new settings to take effect. And if all has gone well, the next time you start Apache, you'll see something like this:

    Apache/1.3.14 (Win32) tomcat/1.0 running...

    This indicates that the JServ module has been loaded, and is available for use with Tomcat.

    There is another Windows-specific problem you might encounter at this stage. If your Tomcat server has been installed to a directory with a so-called "long" file path, and this long path contains spaces or strange characters (say, C:\PROGRAM FILES\TOMCAT\WEBAPPS\EXAMPLES), Apache may barf with a complaint about aliases. In this case, note the line number with the error, open up the "tomcat-apache.conf" file, and enclose the long file paths in double quotes to fix the problem.

    Finally, the acid test. Start up Tomcat

    C:\TOMCAT\BIN>TOMCAT START Including all jars in C:\TOMCAT\LIB in your CLASSPATH. Using CLASSPATH: C:\TOMCAT\CLASSES;C:\TOMCAT\LIB\ANT.JAR;C:\TOMCAT\LIB\JAXP.JAR;C:\TOMCAT\LIB \SERVLET.JAR;C:\TOMCAT\LIB\PARSER.JAR;C:\TOMCAT\LIB\WEBSER~1.JAR;C:\TOMCAT\L IB\JASPER.JAR;C:\JDK\LIB\TOOLS.JAR Starting Tomcat in new window 2001-01-30 02:47:19 - ContextManager: Adding context Ctx( /examples ) 2001-01-30 02:47:19 - ContextManager: Adding context Ctx( /admin ) Starting tomcat. Check logs/tomcat.log for error messages 2001-01-30 02:47:20 - ContextManager: Adding context Ctx( ) 2001-01-30 02:47:20 - ContextManager: Adding context Ctx( /test ) 2001-01-30 02:47:22 - PoolTcpConnector: Starting HttpConnectionHandler on 8080 2001-01-30 02:47:22 - PoolTcpConnector: Starting Ajp12ConnectionHandler on 8007

    Then start up Apache.

    Apache/1.3.14 (Win32) tomcat/1.0 running...

    And point your browser to http://localhost/examples/jsp/hello.jsp. If Tomcat, Apache and JServ are all configured properly, your JSP page should be parsed by the Tomcat engine and returned correctly to the browser. You can now use Apache to serve JSP documents without the necessity of specifying the port number in the URL.

    In case you need to stop the Tomcat server, you can use

    C:\TOMCAT\BIN>TOMCAT STOP Including all jars in C:\TOMCAT\LIB in your CLASSPATH. Using CLASSPATH: C:\TOMCAT\CLASSES;C:\TOMCAT\LIB\ANT.JAR;C:\TOMCAT\LIB\JAXP.JAR;C:\TOMCAT\LIB \SERVLET.JAR;C:\TOMCAT\LIB\PARSER.JAR;C:\TOMCAT\LIB\WEBSER~1.JAR;C:\TOMCAT\L IB\JASPER.JAR;C:\JDK\LIB\TOOLS.JAR

    Stop Tomcat

     
     
    >>> 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