Object-Oriented Enterprise Application Development Tomcat 3.2 Configuration Last Updated: 03/30/2001.

Slides:



Advertisements
Similar presentations
Using JavaServer Pages Harry R. Erwin, PhD CIT304/CSE301.
Advertisements

JSP: JavaServer Pages Juan Cruz Kevin Hessels Ian Moon.
J4www/jea Week 3 Version Slide edits: nas1 Format of lecture: Assignment context: CRUD - “update details” JSP models.
Installing JDK and Tomcat Vijayan Sugumaran Department of DIS Oakland University.
Starting with Gridsphere Albert Einstein Institute Gridsphere Installation.
WEB1P servintro1 Introduction to servlets and JSP Dr Jim Briggs.
Installing JDK and Tomcat Vijayan Sugumaran Department of DIS Oakland University.
Configuring web servers and web applications 1. 2 Server configuration vs. application configuration A web server may run several web application Server.
Object-Oriented Enterprise Application Development Javadoc Last Updated: 06/30/2001.
1 Build a Web Application on J2EE. 2 J2EE Scenario Client – Web Server – EIS Resources Client – Web Server – EIS Resources Client – Application Server.
Apache Tomcat Representation and Management of Data on the Web.
DT211/3 Internet Application Development Web Servers.
MC365 Application Servers: Java Server Pages (JSP’s) and Session Management.
Objectives:1. Investigate the Web application deployment descriptor 2. Install and deploy Tomcat and struts 3. Design and deploy a struts application Struts.
1 Java Server Pages Can web pages be created specially for each user? What part does Java play?
Tomcat Configuration A Very, Very, Very Brief Overview.
Web programming for project students Dr Jim Briggs.
Creating a.war file W(eb) AR(chive). Creating a.war file The following article may contain actual software programs in source code form. This source code.
Web Applications Basics. Introduction to Web Web features Clent/Server HTTP HyperText Markup Language URL addresses Web server - a computer program that.
CS 160: Software Engineering August 27 Class Meeting Department of Computer Science San Jose State University Fall 2014 Instructor: Ron Mak
Java web development Servlet & Java server pages.
Java Servlets and JSP.
Introduction to Java web programming Dr Jim Briggs JWP intro1.
Java Enterprise Edition Java Web Development Structure of a web project Introduction to Web Applications The first project Introduction to Java Web Development.
Configuring Apache tomcat Specifying the server port NOTE: Edit the install_dir/conf/server.xml and change the port attribute of the connector element.
Tomcat Celsina Bignoli History of Tomcat Tomcat is the result of the integration of two groups of developers. – JServ, an open source.
Intro to Servlets Lec 26. Web-Based Enterprise Applications in Java Figure shows a simplified view of one application and its layers.
UNIT-V The MVC architecture and Struts Framework.
DAT602 Database Application Development Lecture 15 Java Server Pages Part 1.
Web server and web browser It’s a take and give policy in between client and server through HTTP(Hyper Text Transport Protocol) Server takes a request.
Installing and Configuring Tomcat A quick guide to getting things set up on Windows.
Apache Tomcat Web Server SNU OOPSLA Lab. October 2005.
M. Taimoor Khan * Java Server Pages (JSP) is a server-side programming technology that enables the creation of dynamic,
Java Servlets CS-422. Application Mapping Your servlet application will be mapped to a directory structure: –“myapp” maps to some directory C:/docs/apps/myapp.
Tomcat Spencer Uresk. Notes This is a training NOT a presentation Please ask questions This is being recorded
Apache + Tomcat. Apache + Tomcat Download mod_webapp.so:
Application Servers: Tomcat. What is an application server? Servlets are Java’s answer to server-side programming. Servlets are a special type of Java.
CS441 CURRENT TOPICS IN PROGRAMMING LANGUAGES LECTURE 5_1 George Koutsogiannakis/ Summer
AN OVERVIEW OF SERVLET TECHNOLOGY SERVER SETUP AND CONFIGURATION WEB APPLICATION STRUCTURE BASIC SERVLET EXAMPLE Java Servlets - Compiled By Nitin Pai.
111 Java Servlets Dynamic Web Pages (Program Files) Servlets versus Java Server Pages Implementing Servlets Example: F15 Warranty Registration Tomcat Configuration.
Tomcat Setup BCIS 3680 Enterprise Programming. Getting Web Apps to Work  Verify that Tomcat works.  Understand how context works.  Create folders/files.
Lecturer: Prof. Piero Fraternali, Teaching Assistant: Alessandro Bozzon, Advanced Web Technologies: Struts–
C HAPTER 11 D EPLOYING YOUR WEB APP. WAR FILE A WAR file is simply a snapshot of your web app structure, in a nice portable, compressed form (it is really.
Topic Java EE installation (Eclipse, glassfish, etc.) Eclipse configuration for EE Creating a Java Web Dynamic Project Creating your first servlet.
Installing and Configuring Tomcat SSE. Downloading Tomcat l Download url: 4.0/release/v4.1.24/bin/
Java Enterprise Edition Programming Page 1 of 9Configuring Servlets Web Application Context Name  In multiple web applications, a “context name” is used.
Core basic Java web server technologies. Tools Eclipse IDE for Java EE Developers (Netbeans also works) nloads/packages/eclipse-
Chapter 3 JSP Overview. The Problem with Servlets processing the request and generating the response are both handled by a single servlet class Java programming.
STRUCTURE OF JSP PRESENTED BY: SIDDHARTHA SINGH ( ) SOMYA SHRIVASTAV ( ) SONAM JINDAL ( )
17 Copyright © 2004, Oracle. All rights reserved. Deploying an ADF Application.
HTTP protocol Java Servlets. HTTP protocol Web system communicates with end-user via HTTP protocol HTTP protocol methods: GET, POST, HEAD, PUT, OPTIONS,
1 Java Server Pages A Java Server Page is a file consisting of HTML or XML markup into which special tags and code blocks are inserted When the page is.
NJIT 1 Apache Tomcat (Version 6.0) THETOPPERSWAY.COM.
Java Programming: Advanced Topics 1 Building Web Applications Chapter 13.
Tomcat Setup BCIS 3680 Enterprise Programming. One-Click Tomcat Setup 2  This semester we’ll try to set up Tomcat with a PowerShell script.  Preparation.
1 Web Programming with Servlets & JSPs WEB APPLICATIONS – AN OVERVIEW.
A Presentation Presentation On JSP On JSP & Online Shopping Cart Online Shopping Cart.
CS320 Web and Internet Programming Introduction to Java Servlets Chengyu Sun California State University, Los Angeles.
Deploying Web Applications to Tomcat Server Chun Guo
CS3220 Web and Internet Programming Introduction to Java Servlets
Tomcat Celsina Bignoli
Course Outcomes of Advanced Java Programming AJP (17625, C603)
By Dr. Kodge Bheemashankar G
Knowledge Byte In this section, you will learn about:
Introduction to Struts
Apache Tomcat Web Server
Introduction to JBoss application server
ESIS Consulting LLC (C) ESIS Consulting LLC. All rights reserved
Java Servlets and JSP.
CS3220 Web and Internet Programming Introduction to Java Servlets
Presentation transcript:

Object-Oriented Enterprise Application Development Tomcat 3.2 Configuration Last Updated: 03/30/2001

Topics This Tomcat overview examines: Creating a new server Starting and stopping the server The web.xml file Installing web components Running servlets and JavaServer Pages

Application Servers

Functions A web server is software that provides the ability to reference both static and dynamic web resources. It is really designed to be a repository for all web-based business logic. This software abstracts the routine mechanics of executing this components so that we don't have to do it.

Servlet Engines To execute a servlet or JavaServer Page, you must have an appropriate engine. The engine is the software that handles requests for a particular type of resource. A servlet engine handles servlet requests. A JSP engine handles requests for JavaServer Pages.

Web Connectors When a web server receives a request for static content such as an HTML document, it handles the request itself. When a request for dynamic content, such as a servlet, is received, the web server must hand that request off to the web container for processing. This is the job of the web connector.

Jakarta - Tomcat Jakarta-Tomcat is the servlet and JavaServer Pages engine available from the Apache Group. Tomcat is small, installs quickly, and is free. The current version is Tomcat 3.2. For this class, Tomcat will be acting as both a web and application server.

Server Configuration

Tomcat Root The directory where you installed Tomcat is called the. For instance: c:\apache\jakarta-tomcat We'll use the as our point of reference for all Tomcat configuration and installation issues.

Document Root Change to the webapps directory under the. Create a new directory for this class called se452. This new directory is the for the new application.

Directory Structure Within your, create the following directory structure: /WEB-INF /WEB-INF/classes /WEB-INF/lib All directory and file names are case- sensitive.

Server Configuration (1 of 2) Once you've chosen a for your application, you need to make Tomcat aware of it. If any part of your configuration is incorrect, Tomcat will fail to start. Tomcat records the problem in the /logs directory.

Server Configuration (2 of 2) All tomcat configuration information is stored in /conf. Edit the server.xml file. Add a new Context entry to the file: <Context path="/se452" docBase="webapps/se452" debug="9" reloadable="true" trusted="false"

Servlet Installation

Purpose Before we can execute a servlet, it must be installed under control of the application server. This involves two (2) steps: Installing the servlet's class files Modifying the application's web.xml file.

Deploying Servlets (1 of 2) Servlets are just Java classes. The servlet.class file is copied to the WEB-INF/classes directory. If you're using packages, make sure to install them in the WEB-INF/classes directory.

Deploying Servlets (2 of 2) We need to make Tomcat aware of the fact that a new servlet has been deployed to the server. This is done through the web.xml file. The web.xml file contains important configuration information relevant to the application.

Modifying the web.xml File Once the servlet class files have been installed on the server we need to update the web.xml file. This file allows us to map "pretty" names that are seen by the application's clients to "ugly" names used internally. This file uses an XML format to specify the servlet properties.

Modifying web.xml (1 of 2) We create a new servlet entry in the web.xml file for each servlet: howdy HelloWorld

Modifying web.xml (2 of 2) We next provide a translation from URLs to the servlet name slide: howdy /greetings

JSP Installation

Purpose Before we can execute a JSP, it must be installed under control of the application server. In contrast to servlets, this really only involves a single step: Install the JSP files anywhere you would install a static HTML document. Any embedded Java classes referenced by the JSP must exist in the server's CLASSPATH.

Custom Tags (1 of 2) To deploy a custom tag, you need to install the two components: Tag library descriptor Tag class Each of these elements goes in a separate location.

Custom Tags (2 of 2) The tag library descriptor can go in the same directory as the HTML and JSP files. This is typically the. The tag class package is installed within the /WEB- INF/classes directory.

Changing JavaServer Pages (1 of 3) Tomcat can generally tell if a JSP has changed and will recompile the class. However, this process is not guaranteed to be accurate. You may find yourself making changes to a JSP and those changes not appearing in your output.

Changing JavaServer Pages (2 of 3) There is a directory called work within your. This directory contains all of the translated and compiled JSPs. Within this directory there is a directory for each defined to the Tomcat server.

Changing JavaServer Pages (3 of 3) Make sure that Tomcat has been stopped. Change to the directory that holds your compiled JSPs. Delete any of the.java or.class files as needed. Restart Tomcat.

Tomcat Administration

Bouncing the Server Whenever you make configuration changes to Tomcat you should "bounce" the server. "Bouncing" is a term we use to describe the process of stopping and then immediately restarting a server. For tomcat this means issuing the shutdown and startup commands located in the /bin directory.

Executing Servlets

Executing a Servlet (1 of 2) To execute a servlet, you need to issue a request to Tomcat via a client. The most obvious client to use is a web browser. By default Tomcat listens for requests on port This value can be changed, but for this class 8080 should be fine.

Executing a Servlet (2 of 2) To execute the HelloWorld servlet we just entered into the web.xml file, use the following URI: This works because of the translations established in the web.xml file.

Initialization Parameters

Purpose Sometimes we want a servlet to initialize itself when it's first loaded by the servlet engine. For instance we might want to load some configuration data before allowing the servlet to handle client requests. This approach can be useful for testing your code without writing HTML pages or complex URLs.

Modifying web.xml Initialization parameters are associated with their servlet within the web.xml file: howdy … … parm1 value1

Changing Initialization Parameters If you change the name and/or value of an initialization parameter you'll need to bounce the server. Bouncing the server forces it to re-load the server.xml and web.xml files.

Executing JSPs

Executing a JSP (1 of 2) To execute a JSP, you need to issue a request to Tomcat via a client. The most obvious client to use is a web browser. By default Tomcat listens for requests on port This value can be changed, but for this class 8080 should be fine.

Executing a JSP (2 of 2) To execute the HelloWorld JSP, use the following URI: Unlike servlets, there are no intermediate translations from logical names to physical JSP files.

Resources Tomcat Documentation You should plan on spending some time reading the configuration and user's guides. Most of the problems that you'll experience can have their solutions traced directly back to one of these two guides.