Java
  Home arrow Java arrow Page 5 - 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 - Same Story, Different OS
    ( Page 5 of 7 )

    If you're using Linux, the procedure is almost identical. First, install the Linux version of the JDK to a directory of your choice (I used /usr/local/jdk/) and then follow that up by installing the Tomcat server (/usr/local/tomcat/). You shouldn't usually need to install Apache, since that comes standard on most Linux distros - however, you should check and ensure that the version you have supports loadable modules. You can verify this by typing

    $ /usr/local/apache/bin/httpd -l (assuming that Apache has been installed to /usr/local/apache/)

    and viewing the resulting output - if you see the line

    mod_so.c

    in the list of compiled-in modules, you're good to go. If not, you'll need to recompile your Apache server with support for loadable modules.

    You first need to test whether the Tomcat server is working in stand-alone mode. First set the environment variables JAVA_HOME and TOMCAT_HOME to the appropriate locations, like this:

    $ JAVA_HOME=/usr/local/jdk; export JAVA_HOME $ TOMCAT_HOME=/usr/local/tomcat; export TOMCAT_HOME

    Add the Java interpreter to your PATH.

    $ PATH=$PATH:/usr/local/jdk/bin; export PATH

    And then run Tomcat using the shell script in the /usr/local/tomcat/bin directory

    $ /usr/local/tomcat/bin/tomcat.sh start

    Tomcat should start up, displaying messages similar to the ones above.

    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 /usr/local/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>

    Next, you have to set up Apache to communicate with Tomcat via mod_jserv. Install the mod_jserv.so module that you downloaded (you can either get the source and compile it, or use one of the pre-built RPMs) and then edit Apache's "httpd.conf" file to insert the following lines into it:

    LoadModule jserv_module modules/mod_jserv.so

    If you're using an RPM, this may be done for you automatically.

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

    Include /usr/local/tomcat/conf/tomcat-apache.conf

    Shut down Apache, start Tomcat, and then restart Apache. If all has gone well, you should now be able to browse to http://localhost/examples/jsp/hello.jsp and view the JSP document correctly.

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