Java & Tomcat

download Java & Tomcat

of 28

Transcript of Java & Tomcat

  • 7/30/2019 Java & Tomcat

    1/28

    YoLinux Tutorial: Java Servlets, JSP, Jakarta-

    Tomcat, a Database (PostgreSQL or

    MySQL), Apache and Linux

    This covers dynamic content using JAVA servlets, JAVA Server Pages (JSP and

    JASPER page compiler), Jakarta-Tomcat, Apache and a Database (PostgreSQL

    or MySQL) on Red Hat Linux 7.2. A configuration presented here will allow one

    to make a web request to the Apache web server which will recognize it asrequest for a servlet to be handled by Tomcat. Tomcat, the Java Servlet and JSP

    engine, will execute the Java Servlet which will use JDBC to access a database

    (PostgreSQL or MySQL). The servlet will dynamically generate a web page

    based on the results of the database query and will provide these results to

    Apache which will deliver the web content back to the requesting browser.

    Instead of using C/C++ or PERL for a CGI back-end web server process, one

    may use JAVA servlets processed by the Jakarta project's "Tomcat". Apache will

    be configured to use the module mod_jk to communicate with Jakarta-Tomcat

    and it's JVM (JAVA virtual machine). Servlet programs are written as JAVA

    classes which inherit from "HttpServlet" to provide much of their principal

    function.

    JAVA Server Pages (JSP) will utilize Tomcat's JASPER page compiler to

    generate dynamic web pages based on custom tags in one's HTML pages which

    are processed and served. These pages use the tag "" to denote JSP

    directives to be dynamically processed.

    http://www.burstnet.com/ads/ad9427a-map.cgi/ns/v=2.0S/sz=468x60A%7C728x90A/
  • 7/30/2019 Java & Tomcat

    2/28

    It has been my experience on this project that the configurations for the versions

    of software discussed here are very specific to the release. In this case we will be

    using Tomcat 4.0. Older releases of Tomcat (version 3) are configured

    differently. These versions of Tomcat and Apache can also be installed on newer

    releases of the operating system.

    An example of a Java Servlet using JDBC to access a database (PostgreSQL or

    MySQL) is also covered.

    Contents:

    Java JDK 1.4 - Installation, configuration

    Jakarta Project: Tomcat 4.0 - Installation, configuration

    Simple Java Servlet Example

    Apache 1.3 - Tomcat 4.0 Configuration(Note: Apache 2.0 re-architected the way it handles modules. It will be

    incompible with the mod_jk module used in this tutorial.) Using a Servlet to connect and retrieve data from a database

    Links

    Books

    Note: Make sure your computer has massive amounts of memory!!!!

    Related

    YoLinux

    Tutorials:

    Java on

    Linux

    IBM

    Webspher

    e

    YoLinux

    Tutorials

    Index

    JAVAInstallation/Configuration:

    In order to write and compile a JAVA programs, applets or servlets one

    must download the JAVA Development Kit (JDK) which provides a

    compiler, class libraries and tools to compile and run JAVA code. In

    this tutorial we will use the Sun JDK but I'm sure any will do. See

    YoLinux JAVA for a list of available JDK's for Linux.

    Downloadthe Sun JDK:

    JAVA 2 Standard Edition - Main page and info

    Java 2 Platform (J2SE), Standard Edition version 1.4

    http://java.sun.com/j2se/1.4/download.html - Actual Download

    Note: The Java Runtime Environment (JRE) will be adequate to

    configure the server environment but the Software Development Kit(SDK) is required if one wants to write and compile JAVA programs.

    The "Forte SDK" is a full blown interactive GUI driven development

    environment. The SDK is available in RPM and tar format.

    Download j2sdk-1_4_0-linux-i386-rpm.bin

    chmod +x j2sdk-1_4_0-linux-i386-rpm.bin

    ./j2sdk-1_4_0-linux-i386-rpm.bin

    http://www.yolinux.com/TUTORIALS/LinuxTutorialTomcat.html#JAVAJDKhttp://www.yolinux.com/TUTORIALS/LinuxTutorialTomcat.html#TOMCAThttp://www.yolinux.com/TUTORIALS/LinuxTutorialTomcat.html#SERVLET1http://www.yolinux.com/TUTORIALS/LinuxTutorialTomcat.html#APACHETOMCAThttp://www.yolinux.com/TUTORIALS/LinuxTutorialTomcat.html#DATABASEhttp://www.yolinux.com/TUTORIALS/LinuxTutorialTomcat.html#LINKShttp://www.yolinux.com/TUTORIALS/LinuxTutorialTomcat.html#BOOKShttp://www.yolinux.com/TUTORIALS/LinuxTutorialJava.htmlhttp://www.yolinux.com/TUTORIALS/LinuxTutorialJava.htmlhttp://www.yolinux.com/TUTORIALS/LinuxTutorialJava.htmlhttp://www.yolinux.com/TUTORIALS/LinuxTutorialWebSphere.htmlhttp://www.yolinux.com/TUTORIALS/LinuxTutorialWebSphere.htmlhttp://www.yolinux.com/TUTORIALS/LinuxTutorialWebSphere.htmlhttp://www.yolinux.com/TUTORIALS/index.htmlhttp://www.yolinux.com/TUTORIALS/index.htmlhttp://www.yolinux.com/TUTORIALS/index.htmlhttp://www.yolinux.com/TUTORIALS/LinuxTutorialJava.htmlhttp://java.sun.com/j2se/http://java.sun.com/j2se/1.4/index.htmlhttp://java.sun.com/j2se/1.4/index.htmlhttp://java.sun.com/j2se/1.4/download.htmlhttp://java.sun.com/j2se/1.4/download.htmlhttp://www.yolinux.com/TUTORIALS/LinuxTutorialTomcat.html#JAVAJDKhttp://www.yolinux.com/TUTORIALS/LinuxTutorialTomcat.html#TOMCAThttp://www.yolinux.com/TUTORIALS/LinuxTutorialTomcat.html#SERVLET1http://www.yolinux.com/TUTORIALS/LinuxTutorialTomcat.html#APACHETOMCAThttp://www.yolinux.com/TUTORIALS/LinuxTutorialTomcat.html#DATABASEhttp://www.yolinux.com/TUTORIALS/LinuxTutorialTomcat.html#LINKShttp://www.yolinux.com/TUTORIALS/LinuxTutorialTomcat.html#BOOKShttp://www.yolinux.com/TUTORIALS/LinuxTutorialJava.htmlhttp://www.yolinux.com/TUTORIALS/LinuxTutorialJava.htmlhttp://www.yolinux.com/TUTORIALS/LinuxTutorialWebSphere.htmlhttp://www.yolinux.com/TUTORIALS/LinuxTutorialWebSphere.htmlhttp://www.yolinux.com/TUTORIALS/LinuxTutorialWebSphere.htmlhttp://www.yolinux.com/TUTORIALS/index.htmlhttp://www.yolinux.com/TUTORIALS/index.htmlhttp://www.yolinux.com/TUTORIALS/index.htmlhttp://www.yolinux.com/TUTORIALS/LinuxTutorialJava.htmlhttp://java.sun.com/j2se/http://java.sun.com/j2se/1.4/index.htmlhttp://java.sun.com/j2se/1.4/download.html
  • 7/30/2019 Java & Tomcat

    3/28

    rpm -ivh j2sdk-1_4_0-fcs-linux-i386.rpm

    SDK installed in /usr/java/j2sdk1.4.0/.

    Configuration:

    Set the environment variable PATH. Add statement to

    $HOME/.bash_profile or $HOME/.bashrc or shell script which

    controls the environment.PATH=/usr/java/j2sdk1.4.0/bin:$PATHexport PATHexport JAVA_HOME=/usr/java/j2sdk1.4.0exportCLASSPATH=/usr/java/j2sdk1.4.0/lib/tools.jar:/usr/java/j2sdk1.4.0/jre/lib/rt.jar

    The shell script may be re-executed with the command: ..bashrc

    [Potential Pitfall]: Java SDK 1.4.0_03 now requires the current

    working directory to be listed to find files. Add reference to

    current directory ":./" to CLASSPATH.

    exportCLASSPATH=/usr/java/j2sdk1.4.0_03/lib/tools.jar:/usr/java/j2sdk1.4.0_03/jre/lib/rt.jar:./

    Test:

    Use the following test program: Test.javapublic class Test{

    public static void main(String[] args){

    System.out.println("Hello world");}

    }

    Compile: javac Test.java

    (or /usr/java/j2sdk1.4.0/bin/javac Test.java)

    Note that the file name and the class name are the same. This

    became a requirement in JDK 1.4. The result of the compile is

    the file: Test.class

    Run:

    [prompt]$ java TestHello world

    (or /usr/java/j2sdk1.4.0/bin/java Test)

    http://www.burstnet.com/ads/sk9427a-map.cgi/ns/v=2.0S/sz=120x600A/http://www.burstnet.com/ads/sk9427a-map.cgi/ns/v=2.0S/sz=120x600A/http://www.burstnet.com/ads/sk9427a-map.cgi/ns/v=2.0S/sz=120x600A/http://www.burstnet.com/ads/sk9427a-map.cgi/ns/v=2.0S/sz=120x600A/
  • 7/30/2019 Java & Tomcat

    4/28

    Links:

    Sun.com: J2SE 1.4 installation instructions

    J2SE 1.4 Documentation

    Jakarta Project - Tomcat:

    Tomcat is the JAVA "container" or processor for Java Servlets and

    Java Server Pages (JSP). Note also that JAVA must be installed in

    order for Tomcat to operate. (See previous section above) This tutorial

    will focus on the use of Tomcat with Apache but it should be noted that

    the default Tomcat installation enables Tomcat to be a stand-alone http

    web server and servlet container.

    The Jakarta Project: Apache Tomcat JAVA Servlet and JSP containerhome page

    Download:Tomcat 4.0 RPMs (Release: Catalina. Servlet 2.3 and JSP

    1.2 specifications.)

    regexp-1.2-1.noarch.rpm

    servletapi4-4.0.3-1.noarch.rpm - servlet.jar files

    xerces-j-1.4.4-1.noarch.rpm - Xerces is an XML parser available from the

    Apache Software Foundation.

    tomcat4-webapps-4.0.3-1.noarch.rpm

    tomcat4-4.0.3-1.noarch.rpm

    Install:rpm -ivh regexp-1.2-1.noarch.rpm servletapi4-4.0.3-1.noarch.rpm tomcat4-webapps-4.0.3-1.noarch.rpm tomcat4-4.0.3-1.noarch.rpm xerces-j-1.4.4-2.noarch.rpm

    Symlinks generated from /usr/share/java/... to /var/tomcat4/

    Documentation:

    Tomcat 4.0 Documentation

    Also look at local documentation:/usr/share/doc/tomcat4-4.0.3/forrelease notes.

    Local app documentation files:/var/tomcat4/webapps/tomcat-docs/

    Configfile:/etc/tomcat4/conf/tomcat4.conf

    Change the following reference to JAVA_HOME to:

    http://java.sun.com/j2se/1.4/install-docs.htmlhttp://java.sun.com/j2se/1.4/install-docs.htmlhttp://java.sun.com/j2se/1.4/docs/index.htmlhttp://jakarta.apache.org/tomcat/index.htmlhttp://jakarta.apache.org/tomcat/index.htmlhttp://jakarta.apache.org/builds/jakarta-tomcat-4.0/release/v4.0.3/rpms/http://jakarta.apache.org/tomcat/tomcat-4.0-doc/index.htmlhttp://java.sun.com/j2se/1.4/install-docs.htmlhttp://java.sun.com/j2se/1.4/docs/index.htmlhttp://jakarta.apache.org/tomcat/index.htmlhttp://jakarta.apache.org/tomcat/index.htmlhttp://jakarta.apache.org/builds/jakarta-tomcat-4.0/release/v4.0.3/rpms/http://jakarta.apache.org/tomcat/tomcat-4.0-doc/index.html
  • 7/30/2019 Java & Tomcat

    5/28

    JAVA_HOME=/usr/java/j2sdk1.4.0

    Notes:

    JAVA environment variable seem to be set here rather

    than in a start script.

    Environment variable options:

    o CATALINA_HOME: Tomcat installation directoryo CATALINA_OPTS example: export

    CATALINA_OPTS="-Djava.ext.dirs=/dummy_dir" Command line switches to pass to the Java

    Runtime Environment

    o CLASSPATH: Optional - Runs without this but I

    used it when adding custom JAR files(CLASSPATH=$CLASSPATH:/var/tomcat4/lib:/usr/share/pgsql:/usr/java/jre/lib:/usr/java/j2sdk1

    .4.0/lib:) Tomcat will execute as user tomcat4

    Configfiles:

    /var/tomcat4/conf/server.xml - Servlet container configuration:

    Defines services offered, TCP port numbers for services, SSL,

    JDBC configuration for MySQL (user/passwd), PostgreSQL,

    Oracle, ODBC, etc. Later we will configure Apache to use one of

    these services.

    /var/tomcat4/conf/web.xml - Tomcat's built-in http server global

    config file: Defines servlets to be processed by Tomcat. Some

    are predefined to perform pre-configured tasks like SSI, JSP,etc.

    /var/tomcat4/conf/catalina.policy - Security policy

    permissions for Tomcat

    /var/tomcat4/webapps/examples/WEB-INF/web.xml - Application

    specificconfig file.

    Later we will use Tomcat with Apache's http server.

    Start:service tomcat4 start (or: /etc/init.d/tomcat4 start)

    Or execute init script directly: /etc/rc.d/init.d/tomcat4 startTo add to init boot process: /sbin/chkconfig --add tomcat4

    Tomcat (and listener socket waiting for requests) will start before

    Apache so that Apache will have a socket to which it can

    connect and communicate. Tomcat will also stop after Apache.

    Have patience as there is a lot of stuff going on. Use the

    command top to look at all the JAVA processes being initiated.

  • 7/30/2019 Java & Tomcat

    6/28

    When the top processes are no longer Java, then Tomcat is

    probably ready.

    [Potential Pitfall]: Note that the command service tomcat4 stop

    was not always successful in stopping all Java processes. Use

    the command ps -auwx | grep tomcat to measure success.

    Test:

    http://localhost:8180/

    http://localhost:8180/examples/jsp/index.html - JSP samples

    Note:

    Port 8180 is defined in /var/tomcat4/conf/server.xml.

    If changed you must restart Tomcat: service tomcat4

    restart (or: /etc/init.d/tomcat4 restart)If using stand-alone and not with Apache, change this to

    port 80.

    Tomcat includes an http server which this test is using.

    We will be integrating it into the Apache environment sothat Apache will be the default server and Tomcat will be

    processing JSP's and Servlets.

    Tomcat Log files: /var/tomcat4/logs/

    Application directories:

    o Servlets and utility classes:/var/tomcat4/webapps/examples/WEB-INF/classes/

    o JAR files and JDBC drivers:/var/tomcat4/webapps/examples/WEB-INF/lib/

    TomcatManager:Tomcat comes with a web management interface. (It's weak, so

    don't expect much.)

    The access is controlled by the file /var/tomcat4/conf/tomcat-

    users.xml Add a manager definition in tomcat-users.xml:

    http://localhost:8180/http://localhost:8180/examples/jsp/index.htmlhttp://localhost:8180/http://localhost:8180/examples/jsp/index.html
  • 7/30/2019 Java & Tomcat

    7/28

    - Added thisline with "manager role"

    - See: Sun Java GettingStarted Guide

    Then restart: service tomcat4 restart

    Use URL to list web applications:

    http://localhost:8180/manager/list

    Note:

    Do NOT make a login error. It does not forgive easily.Access from a different host to recover.

    Do not access before configuring tomcat-users.xml

    because of this.

    Documentation: http://localhost:8180/tomcat-

    docs/manager-howto.html - [Web]

    Notes:

    The rpm tomcat4-webapps-4.0.3-1.noarch.rpm will install many

    examples (JAVA source .java and compiled .class) in

    /var/tomcat4/webapps/. If all you are running are static web pages, JSP and servlets

    then all you may need is Tomcat as it is an http server. If you

    need the functionality of Apache to execute CGI, php and

    support for many of the Apache features then read ahead to

    learn how to use Apache to invoke Tomcat to support JSP and

    Java Servlets.

    JAVAServlet Example:

    File: MyHelloWorld.java

    import java.io.*;import java.text.*;import java.util.*;import javax.servlet.*;import javax.servlet.http.*;

    public class MyHelloWorld extends HttpServlet {

    http://java.sun.com/webservices/docs/ea2/tutorial/doc/GettingStarted2.html#64132http://java.sun.com/webservices/docs/ea2/tutorial/doc/GettingStarted2.html#64132http://localhost:8180/manager/listhttp://localhost:8180/tomcat-docs/manager-howto.htmlhttp://localhost:8180/tomcat-docs/manager-howto.htmlhttp://jakarta.apache.org/tomcat/tomcat-4.0-doc/manager-howto.htmlhttp://jakarta.apache.org/tomcat/tomcat-4.0-doc/manager-howto.htmlhttp://java.sun.com/webservices/docs/ea2/tutorial/doc/GettingStarted2.html#64132http://java.sun.com/webservices/docs/ea2/tutorial/doc/GettingStarted2.html#64132http://localhost:8180/manager/listhttp://localhost:8180/tomcat-docs/manager-howto.htmlhttp://localhost:8180/tomcat-docs/manager-howto.htmlhttp://jakarta.apache.org/tomcat/tomcat-4.0-doc/manager-howto.html
  • 7/30/2019 Java & Tomcat

    8/28

    public void doGet(HttpServletRequest request,HttpServletResponse response)

    throws IOException, ServletException{

    response.setContentType("text/html");

    PrintWriter out = response.getWriter();out.println("");out.println("");out.println("");out.println("Hello World!");out.println("");out.println("");out.println("Hello World!");out.println("");out.println("");

    }}

    CreateSourceFile:/var/tomcat4/webapps/examples/WEB-

    INF/classes/MyHelloWorld.java

    SetCLASSPATH environmentvariable:

    export CLASSPATH=$CLASSPATH:/var/tomcat4/common/lib/servlet.jar

    ORexportCLASSPATH=/usr/java/j2sdk1.4.0/lib/tools.jar:/usr/java/j2sdk1.4.0/jre/lib/rt.jar:/var/tomcat4/common/lib/servlet.jar

    Note: /var/tomcat4/common/lib/servlet.jar is soft linked to

    /usr/share/java/servlet-2.3.jar.

    Compile:

    [prompt]$ cd /var/tomcat4/webapps/examples/WEB-INF/classes/[prompt]$ javac MyHelloWorld.java

    (OR/usr/java/j2sdk1.4.0/bin/javac MyHelloWorld.java )

    This creates file: /var/tomcat4/webapps/examples/WEB-INF/classes/MyHelloWorld.class

    Note:

    Java class com.mycompany.mypackage.MyServlet would be

    stored in /WEB-INF/classes/com/mycompany/mypackage/MyServlet.class

    Libraries (JAR files, JDBC drivers, etc) held in /WEB-INF/lib/ if

    one follows standard configuration. (I took the easy path

    instead.)

  • 7/30/2019 Java & Tomcat

    9/28

    TomcatTest:http://localhost:8180/examples/servlet/MyHelloWorld

    Don't expect a lot. It just generates a web page dynamically which

    states "Hello World".

    Note:

    The mapping of path /var/tomcat4/webapps/examples/WEB-

    INF/classes/ to the URL /examples/servlet/ is defined in

    /var/tomcat4/conf/web.xml. Look for the XML tag "".

    Many examples with source code are included with Tomcat.

    See: http://localhost:8180/examples/servlets/index.html

    Apache- TomcatConfiguration:

    Apache is a fast and configurable web server. This section covers

    using Apache as the primary web server but using Tomcat to process

    JSP and Servlets. This configuration uses the AJP (Apache JServ

    Protocol) connector element (mod_jk) to perform this task. The Apache

    module mod_jk will send servlet requests to Tomcat using TCP/IP

    sockets for communications. Module mod_jk works with Tomcat

    versions 3.x and 4.x.

    There are numerous Apache connection modules:

    Connector

    Name

    ApacheModule

    NameConnectionProtocol

    Tomcat

    Version

    AJP mod_jk AJP1.2,AJP1.3 3, 4

    Coyote JK2 mod_jk AJP/JK1.3,AJP/JK1.4 4.1

    WARP mod_webapp WARP 4

    JSERV mod_jserv ?? old

    AJP mod_jkInstallation:

    First check to see if Apache is compiled to support DSO:/usr/sbin/httpd -lIf one of the lines contains the result mod_so.c then support is

    available.

    Download mod_jk RPM: http://jakarta.apache.org/builds/jakarta-tomcat-4.0/release/v4.0.3/rpms/mod_jk-1.3-1.0-1.4.0.2.i386.rpm

    http://localhost:8180/examples/servlet/MyHelloWorldhttp://localhost:8180/examples/servlets/index.htmlhttp://localhost:8180/examples/servlets/index.htmlhttp://jakarta.apache.org/builds/jakarta-tomcat-4.0/release/v4.0.3/rpms/mod_jk-1.3-1.0-1.4.0.2.i386.rpmhttp://jakarta.apache.org/builds/jakarta-tomcat-4.0/release/v4.0.3/rpms/mod_jk-1.3-1.0-1.4.0.2.i386.rpmhttp://localhost:8180/examples/servlet/MyHelloWorldhttp://localhost:8180/examples/servlets/index.htmlhttp://jakarta.apache.org/builds/jakarta-tomcat-4.0/release/v4.0.3/rpms/mod_jk-1.3-1.0-1.4.0.2.i386.rpmhttp://jakarta.apache.org/builds/jakarta-tomcat-4.0/release/v4.0.3/rpms/mod_jk-1.3-1.0-1.4.0.2.i386.rpm
  • 7/30/2019 Java & Tomcat

    10/28

    This module is dependent on the version of Apache one is

    using. For this tutorial I am using Apache 1.3.

    Download EAPI version of mod_jk:http://jakarta.apache.org/builds/jakarta-

    tomcat/release/v3.3/bin/linux/i386/mod_jk-3.3-ap13-eapi.so

    The default Red Hat compiled Apache uses an API called EAPI

    which is incompatible with the version of mod_jk.so included in

    the RPM. Download and rename as

    /usr/lib/apache/mod_jk.so. This will overwrite the version

    installed by the RPM. The RPM is still required for the

    configuration files.

    Or build mod_jk from source:http://jakarta.apache.org/builds/jakarta-tomcat-4.0/release/v4.0.3/src/jakarta-tomcat-connectors-4.0.2-01-src.tar.gz

    o Unpack: tar -xzf jakarta-tomcat-connectors-4.0.2-01-src.tar.gzo cd jakarta-tomcat-connectors-4.0.2-01-

    src/jk/native/apache-1.3/

    o Edit script: build-unix.sh

    Change lines:

    JAVA_HOME=/usr/java/j2sdk1.4.0

    APACHE_HOME=/etc/httpd

    APXS=/usr/sbin/apxs

    cp mod_jk.so /usr/lib/apache

    o Compile: . build-unix.sh

    ConfigurationFile Modifications:

    The configuration file changes discussed below relate to those

    released with the RPM mod_jk-1.3-1.0-1.4.0.2.i386.rpm.

    Define TCP/IP ports will be used for communications between

    Apache and Tomcat.

    o See Tomcat-Apache config file:/etc/httpd/conf/workers.properties(A separate host may also be specified.) (If you are

    defining multiple JVM's/servlet processors, used in virtual

    hosting, each must be assigned a different port.)o Tomcat services are defined in

    /var/tomcat4/conf/server.xml (See "Connector"

    definition) and in the Apache include file mod_jk.conf.

    Resource parameters may also be set to control the

    maximum number of threads which can be spawned.

    Apache configuration to define:

    http://jakarta.apache.org/builds/jakarta-tomcat/release/v3.3/bin/linux/i386/mod_jk-3.3-ap13-eapi.sohttp://jakarta.apache.org/builds/jakarta-tomcat/release/v3.3/bin/linux/i386/mod_jk-3.3-ap13-eapi.sohttp://jakarta.apache.org/builds/jakarta-tomcat/release/v3.3/bin/linux/i386/mod_jk-3.3-ap13-eapi.so
  • 7/30/2019 Java & Tomcat

    11/28

    o module to load for communication with Tomcat. (Add to

    httpd.conf)

    o path (URL of servlets) and/or file types (JSP file types)

    which are destined for Tomcat processing. All requests in

    the given path (servlet location) or request of a given file

    type (i.e. *.jsp) will then be processed by Tomcat. (SeeJkMount directive in Apache include file mod_jk.conf)

    Everything else is served by Apache.

    Modify: /etc/httpd/conf/workers.properties

    workers.tomcat_home=/var/tomcat4 - Changed.Default was /var/tomcat3workers.java_home=/usr/java/j2sdk1.4.0 - Changedto reflect location of JDK

    ps=/worker.list=ajp12, ajp13

    # Define a worker named ajp12 and of type ajp12# Note that the name and the type do not have to match.#worker.ajp12.port=8007worker.ajp12.host=localhostworker.ajp12.type=ajp12worker.ajp12.lbfactor=1

    # Define a worker named Ajp13#worker.ajp13.port=8009worker.ajp13.host=localhost

    worker.ajp13.type=ajp13worker.ajp13.lbfactor=1

    worker.loadbalancer.type=lbworker.loadbalancer.balanced_workers=ajp12, ajp13

    # Defining a worker named inprocess and of type jniworker.inprocess.type=jni

    # Additional class path components.worker.inprocess.class_path=$(workers.tomcat_home)$(ps)server$(ps)lib$(ps)tomcat-ajp.jar - Changed thisline to match location of library.

    worker.inprocess.cmd_line=startworker.inprocess.class_path=$(workers.java_home)$(ps)lib$(ps)tools.jar - This line based on something Iread. (Also modified to match installation)

    # Unix - Sun VM or blackdownworker.inprocess.jvm_lib=$(workers.java_home)$(ps)jre$(ps)lib$(ps)i386$(ps)server$(ps)libjvm.so - Changedthis line to match location of library.

  • 7/30/2019 Java & Tomcat

    12/28

    # Setting the place for the stdout and stderr of tomcatworker.inprocess.stdout=$(workers.tomcat_home)$(ps)logs$(ps)inprocess.stdoutworker.inprocess.stderr=$(workers.tomcat_home)$(ps)logs$(ps)inprocess.stderr

    The effect of this configuration is to define socket listeners and

    communication protocols between Apache and Tomcat.

    Add to: /var/tomcat4/conf/server.xml

    Within the XML tags:...

    Define listener:

    Add definitions for connectors on ports 8007 and 8009 for

    workers.

    For some reason the listener definition has no effect within the

    "Service" tag identified as "Tomcat-Apache". (I don't know why)

    Add to: /etc/httpd/conf/httpd.conf

    LoadModule jk_module /usr/lib/apache/mod_jk.soORLoadModule jk_module modules/mod_jk.so......AddModule mod_jk.c......Include /etc/httpd/conf/mod_jk.conf

    Notes: I added the "LoadModule" statement after the list of all the

    other "LoadModule" statements.

    The statement "AddModule mod_jk.c" is placed after the

    line "ClearModuleList" and after all the "AddModule"

    declarations. Why? I don't know why position is important,

    but when listed as the first "AddModule" entry after

  • 7/30/2019 Java & Tomcat

    13/28

    "ClearModuleList", it would not work.

    The statement modules/mod_jk.so is a relative reference

    from /etc/httpd/. The directory /etc/httpd/modules/ is

    soft linked to /usr/lib/apache/

    File: /etc/httpd/conf/mod_jk.conf(Change references of "tomcat"

    to "tomcat4" throughout the file, otherwise the default file is ok.)

    JkWorkersFile /etc/httpd/conf/workers.propertiesJkLogFile /var/log/httpd/mod_jk.logJkLogLevel info

    # Root context mounts for Tomcat# Format: JkMount URL_PREFIXWORKER_NAMEJkMount /*.jsp ajp13

    JkMount /servlet/* ajp13

    # The following line makes apache aware of the locationof the /examples contextAlias /examples"/var/tomcat4/webapps/examples"

    Options Indexes FollowSymLinks

    # The following line mounts all JSP files and the/servlet/ uri to tomcatJkMount /examples/servlet/* ajp13JkMount /examples/*.jsp ajp13

    # The following line prohibits users from directlyaccess WEB-INF

    AllowOverride Nonedeny from all

    ...

    Virtual host example: (Just an FYI. I never used virtual hosting but

    wanted to let everyone know it is available.)

    Configure a new JVM definition to handle requests separately.# First Virtual Host. - Virtual Host examplenot in default file

    DocumentRoot /web/host1ServerName host1.yolinux.com

  • 7/30/2019 Java & Tomcat

    14/28

    JkMount /*.jsp ajp13JkMount /servlet/* ajp13

    AllowOverride Nonedeny from all

    Ajpv13 is the protocol used when Apache communicates with

    Tomcat. This file establishes the sockets and enables this

    communication process.

    If using a virtual host configuration then file

    /etc/httpd/conf/workers.properties must have the following

    entries added:

    ...

    ...

    Run:

    Start Tomcat first: service tomcat4 start

    Start Apache: service httpd start

    After Apache has started, one may perform a syntax check of

    the Apache configuration files with the following command:[root prompt]# /usr/sbin/apachectl configtestIf sucessful it should return the statement: Syntax OK

    [Potential Pitfall]: If you get the following error:[error] Cannot remove module mod_jk.c: not found inmodule listIt is most likely that the placement of the aditional lines in

    /etc/httpd/conf/httpd.conf is incorrect. The additional lines

    must be placed accoring to above directions.

    Test with the URL:

    o Test Tomcat servlet:

    http://localhost/examples/servlet/MyHelloWorld

    o Test static page with Apache: http://localhost/

    Note that we are no longer referencing port 8180 but are

    http://localhost/examples/servlet/MyHelloWorldhttp://localhost/examples/servlet/MyHelloWorldhttp://localhost/examples/servlet/MyHelloWorldhttp://localhost/examples/servlet/MyHelloWorldhttp://localhost/
  • 7/30/2019 Java & Tomcat

    15/28

    referencing a directory which Apache defers to Tomcat for

    processing but Apache handles the request from the browser.

    Log Files:

    Apache:

    o /var/log/httpd/access_log

    o /var/log/httpd/error_log

    Tomcat: /var/tomcat4/logs/...

    Apache-Tomcat modulemod_jk: /var/log/httpd/mod_jk.log

    Links:

    The AJP Connector and Tomcat 4.0:

    http://localhost:8180/tomcat-docs/config/ajp.html - [Web]

    Working with mod_jk - Tomcat 3.2 - By Gal Shachor

    Sun Java: Getting Started With Tomcat

    The Database:

    We will cover connectivity to two databases:

    1. PostgreSQL

    2. MySQL

    Note: If connecting to Oracle, use the JDBC driver:oracle.jdbc.driver.OracleDriver

    1) PostgreSQL:

    Install and configure a database. See: YoLinux Tutorial: PostgreSQL

    and Linux

    JDBCand PostgreSQLJARfiles:The "CLASSPATH" variable can set the

    Java runtime environment so that it will find the appropriate Javalibraries (JAR files). Environment variables for Tomcat can be set in

    /etc/tomcat4/conf/tomcat4.conf. One may also set the CLASSPATH

    variable to include PostgreSQL JDBC JAR files. I did not set the

    CLASSPATH environment variable in the configuration file but instead

    employed the default path by performing the following steps:

    http://localhost:8180/tomcat-docs/config/ajp.htmlhttp://localhost:8180/tomcat-docs/config/ajp.htmlhttp://jakarta.apache.org/tomcat/tomcat-4.0-doc/config/ajp.htmlhttp://jakarta.apache.org/tomcat/tomcat-3.2-doc/mod_jk-howto.htmlhttp://java.sun.com/webservices/docs/ea2/tutorial/doc/GettingStarted.htmlhttp://www.yolinux.com/TUTORIALS/LinuxTutorialTomcat.html#POSTGRESQLhttp://www.yolinux.com/TUTORIALS/LinuxTutorialTomcat.html#MYSQLhttp://www.yolinux.com/TUTORIALS/LinuxTutorialPostgreSQL.htmlhttp://www.yolinux.com/TUTORIALS/LinuxTutorialPostgreSQL.htmlhttp://localhost:8180/tomcat-docs/config/ajp.htmlhttp://jakarta.apache.org/tomcat/tomcat-4.0-doc/config/ajp.htmlhttp://jakarta.apache.org/tomcat/tomcat-3.2-doc/mod_jk-howto.htmlhttp://java.sun.com/webservices/docs/ea2/tutorial/doc/GettingStarted.htmlhttp://www.yolinux.com/TUTORIALS/LinuxTutorialTomcat.html#POSTGRESQLhttp://www.yolinux.com/TUTORIALS/LinuxTutorialTomcat.html#MYSQLhttp://www.yolinux.com/TUTORIALS/LinuxTutorialPostgreSQL.htmlhttp://www.yolinux.com/TUTORIALS/LinuxTutorialPostgreSQL.html
  • 7/30/2019 Java & Tomcat

    16/28

    List of PostgreSQL JDBC drivers:

    [prompt]# rpm -ql postgresql-jdbc-7.1.3-2/usr/share/pgsql/jdbc7.0-1.1.jar/usr/share/pgsql/jdbc7.1-1.2.jar

    Place JDBC JAR libraries in path where they can be found:

    cp /usr/share/pgsql/jdbc7.1-1.2.jar /var/tomcat4/lib

    JAVAServlet run under Tomcat, accessingPostgreSQLusing JDBC:

    Java Servlet sourcefile:// File: ShowBedrock.java

    /* A servlet to display the contents of the PostgreSQL

    Bedrock database */

    import java.io.*;import java.sql.*;import java.text.*;import java.util.*;import javax.servlet.*;import javax.servlet.http.*;

    public class ShowBedrock extends HttpServlet{

    public String getServletInfo(){

    return "Servlet connects to PostgreSQL databaseand displays result of a SELECT";}

    private Connection dbcon; // Connection for scopeof ShowBedrock

    // "init" sets up a database connectionpublic void init(ServletConfig config) throws

    ServletException{

    String loginUser = "postgres";String loginPasswd = "supersecret";String loginUrl =

    "jdbc:postgresql://localhost/bedrock";

    // Load the PostgreSQL drivertry

    {Class.forName("org.postgresql.Driver");dbcon =

    DriverManager.getConnection(loginUrl, loginUser,loginPasswd);

  • 7/30/2019 Java & Tomcat

    17/28

    }catch (ClassNotFoundException ex)

    {System.err.println("ClassNotFoundException: " +ex.getMessage());

    throw new ServletException("Class notfound Error");}

    catch (SQLException ex){

    System.err.println("SQLException: " +ex.getMessage());

    }}

    // Use http GET

    public void doGet(HttpServletRequest request,HttpServletResponse response)

    throws IOException, ServletException{

    response.setContentType("text/html"); //Response mime type

    // Output stream to STDOUTPrintWriter out = response.getWriter();

    out.println("Bedrock");

    out.println("Bedrock");

    try {// Declare our statementStatement statement =

    dbcon.createStatement();

    String query = "SELECT name, dept, ";query += " jobtitle ";query += "FROM employee ";

    // Perform the queryResultSet rs =

    statement.executeQuery(query);

    out.println("");

    // Iterate through each row of rswhile (rs.next()){

    String m_name = rs.getString("name");String m_dept = rs.getString("dept");String m_jobtitle =

    rs.getString("jobtitle");

  • 7/30/2019 Java & Tomcat

    18/28

    out.println("" +"" + m_name + ""

    +"" + m_dept + ""

    +"" + m_jobtitle +

    "" + "");}

    out.println("");statement.close();

    }catch(Exception ex)

    {out.println("" +

    "" +"Bedrock: Error" +"\n" +"

    SQL error in doGet: " +

    ex.getMessage() +"

    ");

    return;}

    out.close();}

    }

    Notes:

    String loginUrl = "jdbc:postgresql://localhost/bedrock";

    The format for this is jdbc:postgresql:host-name-of-server:port/database-nameExamples:

    o jdbc:postgresql:bedrock - bedrock is the PostgreSQL

    database name. See PostgreSQL tutorial.

    o jdbc:postgresql://localhost/bedrock

    o jdbc:postgresql://localhost:5432/bedrock - Default

    PostgreSQL standard port number is 5432

    public void doGet(...

    Using http GET request. For http POST operations use doPost

    String m_name = rs.getString("name");

    One may also use database field names or field numbers. i.e.String m_name = rs.getString(1);String m_dept = rs.getString(2);

    SetCLASSPATH environmentvariable:

    export CLASSPATH=$CLASSPATH:/var/tomcat4/lib/jdbc7.1-1.2.jar

    OR

  • 7/30/2019 Java & Tomcat

    19/28

    exportCLASSPATH=/usr/java/j2sdk1.4.0/lib/tools.jar:/usr/java/j2sdk1.4.0/jre/lib/rt.jar:/var/tomcat4/common/lib/servlet.jar:/var/tomcat4/lib/jdbc7.1-1.2.jar

    Compile:

    [prompt]# cd /var/tomcat4/webapps/examples/WEB-INF/classes[prompt]# javac ShowBedrock.java

    (OR/usr/java/j2sdk1.4.0/bin/javac ShowBedrock.java )

    PostgreSQLConfiguration:/var/lib/pgsql/data/postgresql.conf

    Set: tcpip_socket = true

    This allows JDBC to connect to PostgreSQL.

    Test:

    Tomcat only:

    http://localhost:8180/examples/servlet/ShowBedrock

    Apache Request: http://localhost/examples/servlet/ShowBedrock

    Results:

    Bedrock

    Fred Flinstone Quarry Worker Rock DiggerWilma Flinstone Finance Analyst

    Barney Rubble Sales Neighbor

    Betty Rubble IT Neighbor

    JDBC/PostgreSQLLinks:

    PostgreSQL.org: JDBC

    2) MySQL:

    Install and configure a database: YoLinux Tutorial: MySQL and Linux

    DownloadJDBCMM.MySQLJARfile:

    MM.MySQL Downloads

    http://localhost:8180/examples/servlet/ShowBedrockhttp://localhost/examples/servlet/ShowBedrockhttp://www.postgresql.org/idocs/index.php?jdbc.htmlhttp://www.yolinux.com/TUTORIALS/LinuxTutorialMySQL.htmlhttp://sourceforge.net/project/showfiles.php?group_id=15923http://localhost:8180/examples/servlet/ShowBedrockhttp://localhost/examples/servlet/ShowBedrockhttp://www.postgresql.org/idocs/index.php?jdbc.htmlhttp://www.yolinux.com/TUTORIALS/LinuxTutorialMySQL.htmlhttp://sourceforge.net/project/showfiles.php?group_id=15923
  • 7/30/2019 Java & Tomcat

    20/28

    sourceforge.net: mm.mysql-2.0.13-you-must-unjar-me.jar -

    Actual JAR file I used

    Un-JAR and place MM.MySQL JDBC JAR libraries in path where they

    can be found:

    [prompt]# /usr/java/j2sdk1.4.0/bin/jar xf mm.mysql-2.0.13-you-must-unjar-me.jarORif your paths are set properly:[prompt]# jar xf mm.mysql-2.0.13-you-must-unjar-me.jar

    [prompt]# cd mm.mysql-2.0.13/[prompt]# cp mm.mysql-2.0.13-bin.jar /var/tomcat4/lib

    "GRANT ALL PRIVILEGES ON bedrock to 'user@hostname' identified

    by 'password';

    FLUSH PRIVILEGES

    where hostname is localhost.localdomain (not localhost on default RedHat installation)

    JAVAServlet run under Tomcat, accessingMySQLusingJDBC:

    Java Servlet sourcefile: (Note that it does the same thing as the

    PostgrSQL example above but it is written with a different style.)// File: ShowBedrock.java

    /* A servlet to display the contents of the MySQLBedrock database */

    import java.io.*;import java.net.*;import java.sql.*;import java.text.*;import java.util.*;import javax.servlet.*;import javax.servlet.http.*;

    public class ShowBedrock extends HttpServlet{

    public String getServletInfo(){

    return "Servlet connects to MySQL database anddisplays result of a SELECT";}

    // Use http GET

    public void doGet(HttpServletRequest request,HttpServletResponse response)

    throws IOException, ServletException{

    http://telia.dl.sourceforge.net/sourceforge/mmmysql/mm.mysql-2.0.13-you-must-unjar-me.jarhttp://telia.dl.sourceforge.net/sourceforge/mmmysql/mm.mysql-2.0.13-you-must-unjar-me.jar
  • 7/30/2019 Java & Tomcat

    21/28

    String loginUser = "Dude1";String loginPasswd = "SuperSecret";String loginUrl =

    "jdbc:mysql://localhost:3306/bedrock";

    response.setContentType("text/html"); //

    Response mime type

    // Output stream to STDOUTPrintWriter out = response.getWriter();

    out.println("Bedrock");

    out.println("Bedrock");

    // Load the mm.MySQL drivertry

    {Class.forName("org.gjt.mm.mysql.Driver");Connection dbcon =

    DriverManager.getConnection(loginUrl, loginUser,loginPasswd);

    // Declare our statementStatement statement =

    dbcon.createStatement();

    String query = "SELECT name, dept, ";query += " jobtitle ";query += "FROM employee ";

    // Perform the queryResultSet rs =

    statement.executeQuery(query);

    out.println("");

    // Iterate through each row of rswhile (rs.next()){

    String m_name = rs.getString("name");String m_dept = rs.getString("dept");String m_jobtitle =

    rs.getString("jobtitle");out.println("" +

    "" + m_name + ""

    + "" + m_dept + ""+

    "" + m_jobtitle +"" +

    "");}

    out.println("");

  • 7/30/2019 Java & Tomcat

    22/28

    rs.close();statement.close();dbcon.close();

    }catch (SQLException ex) {

    while (ex != null) {

    System.out.println ("SQL Exception:" + ex.getMessage ());ex = ex.getNextException ();

    } // end while} // end catch SQLException

    catch(java.lang.Exception ex){

    out.println("" +"" +"Bedrock: Error" +"\n" +"

    SQL error in doGet: " +ex.getMessage() +

    "

    ");return;

    }out.close();

    }}

    Compile:[prompt]# exportCLASSPATH=/var/tomcat4/common/lib/mm.mysql-2.0.13-bin.jar:$CLASSPATH[prompt]# cd /var/tomcat4/webapps/examples/WEB-INF/classes[prompt]# javac ShowBedrock.java

    (ORexportCLASSPATH=/usr/java/j2sdk1.4.0/lib/tools.jar:/usr/java/j2sdk1.4.0/jre/lib/rt.jar:/var/tomcat4/common/lib/servlet.jar:/var/tomcat4/lib/mm.mysql-2.0.13-bin.jar )(OR/usr/java/j2sdk1.4.0/bin/javac ShowBedrock.java )

    Test:

    Tomcat only:

    http://localhost:8180/examples/servlet/ShowBedrock

    Apache Request: http://localhost/examples/servlet/ShowBedrock

    Notes:

    [Potential Pitfall]: The MySQL "user" table will define users and

    their host. I made the mistake of using "localhost" when the host

    name returned by the Unix command "hostname" was different.

    When the servlet tried to connect to the database it was refused.

    http://localhost:8180/examples/servlet/ShowBedrockhttp://localhost/examples/servlet/ShowBedrockhttp://localhost:8180/examples/servlet/ShowBedrockhttp://localhost/examples/servlet/ShowBedrock
  • 7/30/2019 Java & Tomcat

    23/28

    [prompt]$ hostname

    superserver

    [prompt]$ mysql -h localhost -u root -p

    ...

    mysql>use mysql

    mysql>select user,host from user;

    +-------+------------+

    | user | host |

    +-------+------------+

    | root | |

    | Dude1 | localhost |

    +-------+------------+

    mysql>update user set Host='superserver' whereUser='Dude1';

    Query OK, 1 row affected (0.00 sec)

    Rows matched: 1 Changed: 1 Warnings: 0

    Links:

    JDBC MySQL driver "mm" - [Alt]

    JDBC MySQL driver "Resin"

    Sun.com: JAR file basics

    Nusphere.com: Discussion and explanation of simple JDBC

    mm.MySQL servlet

    MySQL JDBC Examples

    MySQL Links - Lots of JDBC links as well.

    mm.MySQL guide

    MySQL/JDBC example

    JAVAJDBC:

    JAVA JDBC programs require the package: java.sql. Contained within

    this package are:

    Classes:o Date

    o DriverManager

    o DriverPropertyInfo

    o Time

    o Timestamp

    o Types

    Interfaces:o CallableStatement

    o Connection

    o DatabaseMetaData

    o Driver

    http://www.caucho.com/projects/jdbc-mysql/index.xtphttp://www.caucho.com/projects/jdbc-mysql/index.xtphttp://java.sun.com/docs/books/tutorial/jar/basics/index.htmlhttp://www.nusphere.com/products/library/writing_jdbc_mysql.pdfhttp://www.nusphere.com/products/library/writing_jdbc_mysql.pdfhttp://www.nusphere.com/products/library/writing_jdbc_mysql.pdfhttp://www.nusphere.com/products/library/writing_jdbc_mysql.pdfhttp://tecfa.unige.ch/guides/java/staf2x/ex/jdbc/coffee-break/http://tecfa.unige.ch/guides/java/staf2x/ex/jdbc/coffee-break/http://tecfa.unige.ch/guides/java/staf2x/ex/jdbc/coffee-break/http://mmmysql.sourceforge.net/doc/mm.doc/x30.htmhttp://mmmysql.sourceforge.net/doc/mm.doc/x30.htmhttp://www.cs.unc.edu/Courses/comp118/docs/lessons/java/java_jdbc/jdbcServletMysql.htmlhttp://www.cs.unc.edu/Courses/comp118/docs/lessons/java/java_jdbc/jdbcServletMysql.htmlhttp://mmmysql.sourceforge.net/http://www.mysql.com/Downloads/Contrib/http://www.caucho.com/projects/jdbc-mysql/index.xtphttp://java.sun.com/docs/books/tutorial/jar/basics/index.htmlhttp://www.nusphere.com/products/library/writing_jdbc_mysql.pdfhttp://www.nusphere.com/products/library/writing_jdbc_mysql.pdfhttp://tecfa.unige.ch/guides/java/staf2x/ex/jdbc/coffee-break/http://tecfa.unige.ch/guides/mysql/http://mmmysql.sourceforge.net/doc/mm.doc/x30.htmhttp://www.cs.unc.edu/Courses/comp118/docs/lessons/java/java_jdbc/jdbcServletMysql.html
  • 7/30/2019 Java & Tomcat

    24/28

    o PreparedStatement

    o ResultSet

    o ResultMetaData

    o Statement

    JDBC Links:

    Sun's database of JDBC database drivers

    List of JDBC drivers for various databases

    Sun.com: JDBC

    Sun.com: JDBC Basics

    JAVAServer Pages(JSP):

    Basic JSP elements:

    : Define/execute Java statements.

    Example:

    Year: is


    Month: is

    : Execute Java statements. Nothing displayed.

    Example:

    : Execute Java expression and place results here.Example: Calendar:

    : Declare Java variable or method.

    Example:

    JSP's are rarely self contained. JSP's most often require use of classes

    and methods defined in Java programs.

    The samples delivered with Tomcat show numerous JSP examplesand the source code:

    http://localhost:8180/examples/jsp/index.html

    Links:

    Jakarta Project: Tomcat

    http://industry.java.sun.com/products/jdbc/drivershttp://www.minq.se/products/dbvis/reqs.htmlhttp://java.sun.com/docs/books/tutorial/jdbc/basics/index.htmlhttp://java.sun.com/docs/books/tutorial/jdbc/basics/index.htmlhttp://java.sun.com/docs/books/tutorial/jdbc/basics/index.htmlhttp://localhost:8180/examples/jsp/index.htmlhttp://localhost:8180/examples/jsp/index.htmlhttp://jakarta.apache.org/tomcat/index.htmlhttp://industry.java.sun.com/products/jdbc/drivershttp://www.minq.se/products/dbvis/reqs.htmlhttp://java.sun.com/products/jdbc/index.htmlhttp://java.sun.com/docs/books/tutorial/jdbc/basics/index.htmlhttp://localhost:8180/examples/jsp/index.htmlhttp://jakarta.apache.org/tomcat/index.html
  • 7/30/2019 Java & Tomcat

    25/28

    Sun

    o Java Server Pages

    o Java Servlet Technology

    o Sun.com: Java Tutorial

    o Sun.com: Servlets - online book by Cynthia Bloch and

    Stephanie Bodoffo Sun books: Configuring Servlets

    At the Forge - by Reuven M. Lerner

    o Server-Side Java with Jakarta-Tomcat

    o JavaServer Pages

    o Custom JSP Actions

    Tomcat - A Minimalistic User's Guide - Tomcat V3.2 (older)

    configuration.

    Setting Up a Java 2 Environment on Linux

    Linux Magazine: Tomcat - Using WARP connector (mod_webapp)

    instead of mod_jk Linux,Apache, Tomcat configuration for MMBase publishing

    system

    Deploying Web Applications to Tomcat

    J2EE:

    o YoLinux:Installing/configuringIBM WebSphereand DB2 on

    Linux

    o JBoss.org - J2EE Java Enterprise application server -

    Want to define Java Enterprise Bean services which a

    servlet may invoke, use JBoss (or WebSphere).

    o YoLinux:List of Java middlewareservers YoLinuxTutorial: CGI programmingwith C++ and GNUGciCc- Perform

    the same functionality as this Java servlet tutorial but use CGI

    and C++.

    Books:

    "Core Java 2, Volume 1:

    Fundamentals "

    by Cay S. Horstmann, GaryCornell

    ISBN # 0130894680, Prentice

    Hall PTR

    The industry standard. Need I

    say more?

    http://www.sun.com/http://java.sun.com/products/jsp/http://java.sun.com/products/servlet/http://java.sun.com/docs/books/tutorial/index.htmlhttp://java.sun.com/docs/books/tutorial/servlets/index.htmlhttp://java.sun.com/docs/books/tutorial/servlets/TOC.htmlhttp://lerner.co.il/atf/columns/4576.htmlhttp://lerner.co.il/atf/columns/4639.htmlhttp://lerner.co.il/atf/columns/4716.htmlhttp://jakarta.apache.org/tomcat/tomcat-3.2-doc/uguide/tomcat_ug.htmlhttp://www.dougsparling.com/comp/howto/linux_java.htmlhttp://www.linux-mag.com/2001-10/tomcat_01.htmlhttp://www.tldp.org/HOWTO/mini/MMBase-1.htmlhttp://www.tldp.org/HOWTO/mini/MMBase-1.htmlhttp://www.onjava.com/pub/a/onjava/2001/04/19/tomcat.htmlhttp://www.yolinux.com/TUTORIALS/LinuxTutorialWebSphere.htmlhttp://www.yolinux.com/TUTORIALS/LinuxTutorialWebSphere.htmlhttp://jboss.org/http://www.yolinux.com/TUTORIALS/LinuxTutorialJava.html#MIDDLEWAREhttp://www.yolinux.com/TUTORIALS/LinuxTutorialC++CGI.htmlhttp://service.bfast.com/bfast/click?bfmid=2181&sourceid=39358384&bfpid=0130894680&bfmtype=bookhttp://www.amazon.com/exec/obidos/ASIN/0130894680/yolinux-20http://www.sun.com/http://java.sun.com/products/jsp/http://java.sun.com/products/servlet/http://java.sun.com/docs/books/tutorial/index.htmlhttp://java.sun.com/docs/books/tutorial/servlets/index.htmlhttp://java.sun.com/docs/books/tutorial/servlets/TOC.htmlhttp://lerner.co.il/atf/columns/4576.htmlhttp://lerner.co.il/atf/columns/4639.htmlhttp://lerner.co.il/atf/columns/4716.htmlhttp://jakarta.apache.org/tomcat/tomcat-3.2-doc/uguide/tomcat_ug.htmlhttp://www.dougsparling.com/comp/howto/linux_java.htmlhttp://www.linux-mag.com/2001-10/tomcat_01.htmlhttp://www.tldp.org/HOWTO/mini/MMBase-1.htmlhttp://www.tldp.org/HOWTO/mini/MMBase-1.htmlhttp://www.onjava.com/pub/a/onjava/2001/04/19/tomcat.htmlhttp://www.yolinux.com/TUTORIALS/LinuxTutorialWebSphere.htmlhttp://www.yolinux.com/TUTORIALS/LinuxTutorialWebSphere.htmlhttp://jboss.org/http://www.yolinux.com/TUTORIALS/LinuxTutorialJava.html#MIDDLEWAREhttp://www.yolinux.com/TUTORIALS/LinuxTutorialC++CGI.html
  • 7/30/2019 Java & Tomcat

    26/28

    "Distributed Java 2 Platform

    Database Development "

    by Stewart Birnam

    ISBN # 0130268615, Prentice

    Hall PTR

    The industry standard. Need I

    say more?

    "Core Servlets and JavaServer

    Pages (JSP) "

    by Marty Hall

    ISBN # 0130893404, Prentice

    Hall

    "More Servlets and JavaServer

    Pages (JSP) "

    by Marty Hall

    ISBN # 0130676144, Prentice

    Hall

    Tomcat: The Definitive Guide

    by Jason Brittain, Ian F. Darwin

    ISBN # 0596003188 O'Reilly &

    Associates; 1st Edition edition

    "Professional Apache Tomcat"

    by Chanoch Wiggers, Ben

    Galbraith, Vivek Chopra, Sing Li,

    Debashish Bhattacharjee, Amit

    Bakore, Romin Irani, Sandip

    Bhattacharya, Chad Fowler

    ISBN # 0764543725 Wrox

    http://service.bfast.com/bfast/click?bfmid=2181&sourceid=39358384&bfpid=0764543725&bfmtype=bookhttp://www.amazon.com/exec/obidos/ASIN/0764543725/yolinux-20http://service.bfast.com/bfast/click?bfmid=2181&sourceid=39358384&bfpid=0596003188&bfmtype=bookhttp://www.amazon.com/exec/obidos/ASIN/0596003188/yolinux-20http://service.bfast.com/bfast/click?bfmid=2181&sourceid=39358384&bfpid=0130676144&bfmtype=bookhttp://www.amazon.com/exec/obidos/ASIN/0130676144/yolinux-20http://service.bfast.com/bfast/click?bfmid=2181&sourceid=39358384&bfpid=0130893404&bfmtype=bookhttp://www.amazon.com/exec/obidos/ASIN/0130893404/yolinux-20http://service.bfast.com/bfast/click?bfmid=2181&sourceid=39358384&bfpid=0130268615&bfmtype=bookhttp://www.amazon.com/exec/obidos/ASIN/0130268615/yolinux-20
  • 7/30/2019 Java & Tomcat

    27/28

    Apache Jakarta-Tomcat

    by James Goodwill

    ISBN # 1893115364, APress

    Apache Tomcat Security

    Handbook

    by Vivek Chopra, Ben

    Galbriaths, Brian Rickabaugh,

    Gotham Pollysetty, John Turner

    ISBN # 1861008309, Wrox Press

    "JSP, Servlets, and MySQL"by David Harms

    ISBN # 0764547879, Hungry

    Minds, Inc

    "MySQL"

    by Paul DuBois, Michael

    Widenius

    ISBN # 0735709211, New RidersPublishing

    "Manageing and Using MySQL"

    by George Reese, Randy Jay

    Yarger, Tim King

    ISBN # 0596002114, O'Reilly

    http://service.bfast.com/bfast/click?bfmid=2181&sourceid=39358384&bfpid=0596002114&bfmtype=bookhttp://www.amazon.com/exec/obidos/ASIN/0596002114/yolinux-20http://service.bfast.com/bfast/click?bfmid=2181&sourceid=39358384&bfpid=0735709211&bfmtype=bookhttp://www.amazon.com/exec/obidos/ASIN/0735709211/yolinux-20http://service.bfast.com/bfast/click?bfmid=2181&sourceid=39358384&bfpid=0764547879&bfmtype=bookhttp://www.amazon.com/exec/obidos/ASIN/0764547879/yolinux-20http://service.bfast.com/bfast/click?bfmid=2181&sourceid=39358384&bfpid=1861008309&bfmtype=bookhttp://www.amazon.com/exec/obidos/ASIN/1861008309/yolinux-20http://service.bfast.com/bfast/click?bfmid=2181&sourceid=39358384&bfpid=1893115364&bfmtype=bookhttp://www.amazon.com/exec/obidos/ASIN/1893115364/yolinux-20
  • 7/30/2019 Java & Tomcat

    28/28

    PostgreSQL Essential Reference

    by Barry Stinson

    ISBN #0735711216, New Riders

    PostgreSQL: Developer's

    Handbook

    by Ewald Geschwinde, Hans-

    Juergen Schoenig, Hans-Jurgen

    Schonig

    ISBN #0672322609, SAMS

    Practical PostgreSQLJohn C. Worsley, Joshua D.

    Drake

    ISBN #1565928466, O'Reilly

    Beginning Databases with

    PostgreSQL

    by Richard Stones, Neil Matthew

    ISBN #1861005156, Wrox Press

    Inc

    Return tohttp://yolinux.com/for more Linux links,

    information and tutorials

    Return toYoLinux Tutorial Index

    Feedback Form

    Copyright 2002 by Greg Ippolito

    http://www.amazon.com/exec/obidos/ASIN/0735711216/yolinux-20http://yolinux.com/http://yolinux.com/http://www.yolinux.com/TUTORIALS/index.htmlhttp://www.yolinux.com/TUTORIALS/index.htmlhttp://www.yolinux.com/YoLinuxEmailForm.htmlhttp://www.yolinux.com/YoLinuxEmailForm.htmlhttp://service.bfast.com/bfast/click?bfmid=2181&sourceid=39358384&bfpid=1861005156&bfmtype=bookhttp://www.amazon.com/exec/obidos/ASIN/1861005156/yolinux-20http://service.bfast.com/bfast/click?bfmid=2181&sourceid=39358384&bfpid=1565928466&bfmtype=bookhttp://www.amazon.com/exec/obidos/ASIN/1565928466/yolinux-20http://service.bfast.com/bfast/click?bfmid=2181&sourceid=39358384&bfpid=0672322609&bfmtype=bookhttp://www.amazon.com/exec/obidos/ASIN/0672322609/yolinux-20http://service.bfast.com/bfast/click?bfmid=2181&sourceid=39358384&bfpid=0735711216&bfmtype=bookhttp://www.amazon.com/exec/obidos/ASIN/0735711216/yolinux-20http://yolinux.com/http://www.yolinux.com/TUTORIALS/index.htmlhttp://www.yolinux.com/YoLinuxEmailForm.html