An environment for java servlet jsp development apache tomcat
This presentation is the property of its rightful owner.
Sponsored Links
1 / 25

An Environment for Java Servlet & JSP Development ~ Apache Tomcat ~ PowerPoint PPT Presentation


  • 103 Views
  • Uploaded on
  • Presentation posted in: General

An Environment for Java Servlet & JSP Development ~ Apache Tomcat ~. Basic Setup Steps. Download & Install Java S/W Development Kit Download a server (Apache Tomcat) Configure the server Set up development environment Test your setup Establish a deployment method

Download Presentation

An Environment for Java Servlet & JSP Development ~ Apache Tomcat ~

An Image/Link below is provided (as is) to download presentation

Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author.While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server.


- - - - - - - - - - - - - - - - - - - - - - - - - - E N D - - - - - - - - - - - - - - - - - - - - - - - - - -

Presentation Transcript


An environment for java servlet jsp development apache tomcat

An Environment for Java Servlet & JSP Development~ Apache Tomcat ~


Basic setup steps

Basic Setup Steps

  • Download & Install Java S/W Development Kit

  • Download a server (Apache Tomcat)

  • Configure the server

  • Set up development environment

  • Test your setup

  • Establish a deployment method

  • Create custom Web applications


Http tomcat apache org

http://tomcat.apache.org


Install instructions

Install Instructions

  • Get & install 5.5.15 Core Windows Executable

    (apache-tomcat-5.5.15.exe)

  • Configuration

    • Port? (8080 or 80)

    • User: admin

    • Password: webtech


Installation configuration pswd webtech

Installation Configuration(pswd: webtech)


Set path to the installed jvm tomcat 5 5 is designed to run on j2se 5 0 and later

Set Path to the Installed JVM(Tomcat 5.5 is designed to run on J2SE 5.0 and later.)


What s running on port 80

What’s Running on Port 80?

  • IIS

  • Apache HTTP Server

  • Tomcat

  • May need to shut-down other servers or services prior to starting Tomcat.

  • Start/Control/Administrative Tools/Services

    • Select the service, properties, set to Manual


Http localhost index jsp or http localhost 8080

http://localhost(index.jsp) or http://localhost:8080


Index jsp catalina home webapps root index jsp

index.jsp$CATALINA_HOME/webapps/ROOT/index.jsp


Catalina home root of tomcat install

$CATALINA_HOME(root of Tomcat Install)


Observe directory structure

Observe Directory Structure


Test install html jsp servlets

Test Install - HTML, JSP, Servlets

  • Need to test

    • Static HTML

    • JSP

    • Servlets

  • Test files provided

    • Testing.html, Testing.jsp, TestingServlet.java

  • Use default setting (webapps/ROOT)


  • Static html testing html

    Static HTML - Testing.html


    Jsps testing jsp

    JSPs - Testing.jsp


    Servlets testingservlet java

    Servlets – TestingServlet.java

    • Must be compiled, put in appropriate directories, and referenced correctly.


    Check java 2 installation path will compile from command line

    Check Java 2 Installation & Path(will compile from command line)

    >java –version

    >javac –help


    If not

    If NOT?

    • Need to install SDK (http://java.sun.com)

      • Later versions use JRE only (+ Eclipse’s compiler included)

    • Path env var may be needed

      c:\Program Files\Java\jdk1.5.0_04;c:\Program Files\Java\jdk1.5.0_04\bin;


    Need servlet packages

    Need servlet Packages


    Classpath environment variable

    CLASSPATH Environment Variable

    .;C:\Program Files\Apache Software Foundation\Tomcat 5.5\common\lib\servlet-api.jar;

    C:\Program Files\Apache Software Foundation\Tomcat 5.5\common\lib\jsp-api.jar


    Clean compile

    Clean Compile


    Additional server configuration

    Additional Server Configuration

    • Enable invoker servlet

      • Eliminates need for deployment descriptors

      • Handy during development

    • Turn on servlet reloading

      • Checks if servlet has been modified and will be reloaded

      • Handy during development


    Enable invoker servlet

    Enable Invoker Servlet

    • Can run servlets without modifying deployment descriptor

    • Allows you to just drop compiled servlets into WEB-INF/classes directory

    • Modify $CATALINA_HOME\conf\web.xml

      • Uncomment 2 elements (servlet & servlet-mapping)

    • Use URL

      http://localhost/servlet/ServletName


    Servlet reloading

    Servlet Reloading

    • Turn on servlet reloading

      • Ck if has been modified since last load

      • Off by default for production

    • Modify $CATALINA_HOME\conf\context.xml

      <Context reloadable=“true”>

      • Backup prior to changing


    Servlet execution

    Servlet Execution


    Jsps testing jsp1

    JSPs - Testing.jsp


  • Login