Java
  Home arrow Java arrow Page 3 - 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 - One Tomcat, Standing Alone
    ( Page 3 of 7 )

    The first thing you need to do is set up the JDK. Double-click the installable file you just downloaded, and let the program install itself into a convenient location on your hard drive. I'll assume you've installed it to C:\JDK\

    Next, go ahead and install Apache - the default installation location of C:\PROGRAM FILES\APACHE GROUP\APACHE\ is fine - and modify the configuration file "httpd.conf" in case you need to customize its operation. You should test that the server is running by starting it up and pointing your browser to http://localhost/ - if you see an Apache test page, that means your server is up and running. You'll also see an MS-DOS window which displays a status message like this:

    C:\>APACHE Apache/1.3.14 (Win32) running...

    Third step: install the Tomcat Web server. Now, Tomcat comes as a single compressed file, which contains both Linux and Windows versions. You don't need to run an installation program; just unzip it to a convenient location and you're done. I used C:\TOMCAT\ as the location for my Tomcat installation.

    At this point, it's time to see if the Tomcat server is working (Tomcat works independently of Apache as well). Pop open an MS-DOS window, and set up a few of the environment variables Tomcat needs to function correctly.

    C:\>SET JAVA_HOME=C:\JDK C:\>SET TOMCAT_HOME=C:\TOMCAT C:\>SET PATH=%PATH%;C:\JDK\BIN

    Obviously, you need to replace the locations above with the actual file paths on your system.

    Once that's done, change to the Tomcat BIN\ directory and start Tomcat.

    C:\TOMCAT\BIN>TOMCAT START

    If all went well, you should see something like this:

    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

    You should also see a new MS-DOS window with something like this displayed in it:

    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 This indicates that the Tomcat server is running on port 8080.

    If, on the other hand, you got this:

    Out of environment space Out of environment space Out of environment space Out of environment space Out of environment space Out of environment space Out of environment space Out of environment space Out of environment space Out of environment space Out of environment space Out of environment space Out of environment space Out of environment space Out of environment space

    then there's one more thing you need to do. Close the MS-DOS prompt, move to Windows Explorer, and create a new "MS-DOS Prompt" shortcut (you can copy the one in the Start->Programs menu if you like). Right-click the shortcut, find the Memory tab, and change the "Initial Environment" memory size from "Auto" to the maximum (usually 4096 KB). Save the changes to your shortcut, use it to open up a new MS-DOS window, set the environment variables as described above, and try running Tomcat again. This time, things should work as advertised.

    Quick aside: since the variables you set are destroyed each time you exit an MS-DOS session under Windows, I'd recommend that you add them to your C:\AUTOEXEC.BAT startup file so that they are permanently installed in memory. Or you could write a simple batch file which creates and sets the variables in MS-DOS before running Tomcat each time.

    In order to test your Tomcat installation, point your browser to http://localhost:8080/ and try browsing through the various JSP examples available on the default page at http://localhost:8080/examples/jsp/

    Alternatively, you could create a simple JSP file called "hello.jsp" in the directory C:\TOMCAT\WEBAPPS\EXAMPLES\JSP\, containing the following JSP code:

    <html> <body> <% out.println("Waiter, can I have a cup of Java, please?"); %> </body> </html>

    And now, when you point your browser to http://localhost:8080/examples/jsp/hello.jsp, you should be presented with a page which looks like this:

    <html> <body> Waiter, can I have a cup of Java, please? </body> </html>


    If it works, take a deep breath - you're halfway there! Next, you need to get Apache talking with Tomcat, so that you don't need to add the :8080 suffix each time you want to execute a JSP document.

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