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.

Slides:



Advertisements
Similar presentations
May 13th, Lucek Consulting Basic Java Servlet/JSP Web Development David Lucek Lucek Consulting
Advertisements

A Toolbox for Blackboard Tim Roberts
Developing CAS in Eclipse
My First Building Block Presented By Tracy Engwirda 28 September, 2005.
Object-Oriented Enterprise Application Development Tomcat 3.2 Configuration Last Updated: 03/30/2001.
Installing JDK and Tomcat Vijayan Sugumaran Department of DIS Oakland University.
Installing JDK and Tomcat Vijayan Sugumaran Department of DIS Oakland University.
Tomcat Organization Deploying applications. Confusion Like a web server Root locations are from a defined directory location In addition… from that point.
1 Build a Web Application on J2EE. 2 J2EE Scenario Client – Web Server – EIS Resources Client – Web Server – EIS Resources Client – Application Server.
Jsp. JBoss Many servers (like JBoss and Glassfish) are Tomcat servers. The file structures and format for deployment are the same. Where (in what server.
Apache Tomcat Representation and Management of Data on the Web.
27-Jun-15 Directories and DDs. 2 Web apps A web application is basically a web site that: “Knows who you are”--it doesn’t just give you static pages,
MC365 Application Servers: Java Server Pages (JSP’s) and Session Management.
XML-RPC The Quickest Way to Web Services. THE MOVES INSTITUTE XML-RPC XML-RPC is an attempt to implement conventional Remote Procedure Call (RPC) concepts.
Objectives:1. Investigate the Web application deployment descriptor 2. Install and deploy Tomcat and struts 3. Design and deploy a struts application Struts.
Tomcat Configuration A Very, Very, Very Brief Overview.
Building and Deploying a Simple Web Application. Tomcat and JSP Tomcat is an application server, commonly used to host JSP applications Applications are.
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.
Julien Thibault / Phil Brewster / Kristina Doing-Harris
Java Servlets and JSP.
Intro to Servlets Lec 26. Web-Based Enterprise Applications in Java Figure shows a simplified view of one application and its layers.
Servlet and Tomcat Tutorial
1 Deploying a Web Application. 2 Virtual Directories Web servers map URLs to directories in their file systems. Called virtual directories. Normally one.
1 Lecture 5 George Koutsogiannakis/ Summer 2011 CS441 CURRENT TOPICS IN PROGRAMMING LANGUAGES.
Overview of JSP Technology. The need of JSP With servlets, it is easy to – Read form data – Read HTTP request headers – Set HTTP status codes and response.
DAT602 Database Application Development Lecture 15 Java Server Pages Part 1.
M. Taimoor Khan * Java Server Pages (JSP) is a server-side programming technology that enables the creation of dynamic,
Apache Tomcat Representation and Management of Data on the Web.
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.
Movie Manager by Patrick Wesley and Chris Grey Internet Database Project for CS 8630 – Summer 2004 Dr. Guimaraes.
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
Functionality of a web server What does the web server do? Let a user request a resource Find the resource Return something to the user The resource can.
Guidelines for Homework 6. Getting Started Homework 6 requires that you complete Homework 5. –All of HW5 must run on the GridFarm. –HW6 may run elsewhere.
JBoss at Work JAW Motors Application Chapter 1-3 Jeff Schmitt October 9, 2006.
|Tecnologie Web L-A Anno Accademico Laboratorio di Tecnologie Web Introduzione ad Eclipse e Tomcat
Web Applications - Basics. Introduction to Web Web features Clent/Server HyperText Transfer Protocol HyperText Markup Language URL addresses Web server.
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–
Java Servlets & Java Server Pages Lecture July 2013.
Java Servlets Lec 27. Creating a Simple Web Application in Tomcat.
Chapter 7 Using Custom Tag Libraries and the JSP Standard Tag Library.
Chapter 7 Being a JSP. JSP introduction JSP is a solution for two issues  Servlet is difficult for HTML designers since they may not know Java  Formatting.
Ant & Jar Ant – Java-based build tool Jar – pkzip archive, that contains metadata (a manifest file) that the JRE understands.
A seminar on j2ee by saritha. s. What is J2EE J2EE (Java 2 Platform, Enterprise Edition) is a Java platform designed for the mainframe-scale computing.
Chapter 3 Understanding Ant datatypes and properties.
1 Introduction to Web Applications & APIs. 2 Agenda  Architecture of Web Applications Three layer architecture  Web Server (Tomcat) Installation Data.
Deploying a service. Talk titledate2 Talk titledate3 Section SOAP Deployment.
Page 1 R MVC Design Pattern Definition Properties Describing MVC design patterns.
Chapter 1 Introducing Ant. What is ant? Ant is a build tool  Automate the tasks of compiling code, running test, and packaging the results for redistribution.
CS562 Advanced Java and Internet Application Introduction to the Computer Warehouse Web Application. Java Server Pages (JSP) Technology. By Team Alpha.
Database Access Using JDBC BCIS 3680 Enterprise Programming.
Core basic Java web server technologies. Tools Eclipse IDE for Java EE Developers (Netbeans also works) nloads/packages/eclipse-
Building Packages BCIS 3680 Enterprise Programming.
CSI 3125, Preliminaries, page 1 JSP (Java Server Pages)
HTTP protocol Java Servlets. HTTP protocol Web system communicates with end-user via HTTP protocol HTTP protocol methods: GET, POST, HEAD, PUT, OPTIONS,
JAVA, JEE Training Introduction to Web Harinath Mallepally
Topics to be covered (ni) Client side validation JSF (free tools as well) Webservices Tell Resources e.g. sites Packaging and deploying web applications.
CS520 Web Programming Bits and Pieces of Web Programming (II) Chengyu Sun California State University, Los Angeles.
BlueDragon Editions and Advantages Lori Pacheco New Atlanta.
1 Web Programming with Servlets & JSPs WEB APPLICATIONS – AN OVERVIEW.
A Presentation Presentation On JSP On JSP & Online Shopping Cart Online Shopping Cart.
Setting Up First, install tomcat and axis as described elsewhere. Then copy Tomcat into a second folder. –I’ve named mine jakarta- tomcat-server and jakarta-
Deploying Web Applications to Tomcat Server Chun Guo
Checking the Server.
Servlet and Tomcat Tutorial
Checking the Server.
ESIS Consulting LLC (C) ESIS Consulting LLC. All rights reserved
Installing Tomcat.
Presentation transcript:

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 just a JAR file). You jar up your entire web app structure and give it a.war extension. Thus instead of copy static web pages, JSP pages, servlets, and web.xml separately to appropriate locations of Tomcat for deployment, we can simply copy this single WAR file to tomcat’s webapps directory.

WAR FILE Tomcat will be responsible for unpack the WAR file and create a corresponding application context/directory and put all extracted files there. In Tomcat, the name of the WAR file becomes the web app name. – That is, if you drop the file lab8.war to Tomcat’s webapps directory, a new directory called lab8 will be created under the webapps directory.

WAR FILE If you re-deploy the application by dropping an updated WAR file to tomcat’s webapps directory, tomcat will first remove the application context/directory, then extract files from the updated WAR file, and re-create the application context/dir for the application. Another advantage: You do not have to restart your Tomcat server after the re-deployement even if you have servlets inside your application If you want to un-deploy the application, simply delete the WAR file from tomcat’s webapps directory (You do not need to remove the unpacked directory, tomcat will be able to automatically remove it)

What a deployed WAR file looks like Note: META-INF and MANIFEST.MF under it are automatically generated and MANIFEST.MF is used for specifying optional libraries, e.g., the libraries the container cannot find automatically. Classes you deploy in the WEB- INF/classes and JAR files in WEB-INF/lib are available to the container and you don’t have to say anything

M AKING STATIC CONTENT AND JSP S DIRECTLY ACCESSIBLE When you deploy static HTML and JSPs, you can choose whether to make them directly accessible from outside the web app. By directly accessible, we mean that a client can enter the path to the resource into his browser, and the server will return the resource. – You can prevent direct access by putting files under WEB-INF

U SE ANT TO BUILD THE WAR FILE You can use Ant task war to build a WAR file Two options: Use ANT war task Use ANT jar task

(only part of the build file is shown here) <javac srcdir="src" destdir="classes">

WAR FILE

U SE A NT TO BUILD WAR FILE If you have third party library JAR files, when deployed, it is located at WEB-INF/lib direcotry of your web application. If you build a WAR file, you may include these libraries in corresponding place

You may create a dir lib to store other third party library such as JDBC driver Pack the third party library here

WAR FILE We can use ANT jar task to build the WAR file too. In this case, you create another dir called build as the place for assembling all the files in this place. Using ANT war task is more convenient, since this assembly step is avoided.

…………………. Directory build and its sub- directories are places for assembling files

Since WAR file is simply a JAR file, we can use ANT jar task to jar the files we assembled in the build directory.

H OW TO FIND OUT WHAT IS INSIDE THE GENERATED WAR FILE C:\J2EE_C~1\LAB9_A~2\LAB9_A~1\dist> jar tvf lab9a_2.war 0 Tue Nov 23 13:53:28 EST 2010 META-INF/ 106 Tue Nov 23 13:53:26 EST 2010 META-INF/MANIFEST.MF 0 Tue Nov 23 13:53:28 EST 2010 WEB-INF/ 0 Tue Nov 23 13:53:28 EST 2010 WEB-INF/classes/ 0 Tue Nov 23 13:53:28 EST 2010 WEB-INF/classes/edu/ 0 Tue Nov 23 13:53:28 EST 2010 WEB-INF/classes/edu/nku/ 0 Tue Nov 23 13:53:28 EST 2010 WEB- INF/classes/edu/nku/j2ee/ 0 Tue Nov 23 13:53:28 EST 2010 WEB-INF/lib/ 235 Tue Nov 23 13:53:28 EST 2010 WEB- INF/classes/edu/nku/j2ee/CounterBean.class 304 Tue Nov 23 13:53:28 EST 2010 WEB-INF/web.xml 481 Tue Nov 23 13:53:28 EST 2010 counter.jsp 488 Tue Nov 23 13:53:28 EST 2010 index.htm 2573 Tue Nov 23 13:53:28 EST 2010 index.jpg 616 Tue Nov 23 13:53:28 EST 2010 prog.jsp If you want to find out what is inside the generated WAR file, you can use the command: jar tvf name_of_WAR_file You may noticed that when you use ant war task or jar task to generate the WAR file, it automatically creates a directory called META-INF and a file MANIFEST.MF under it.

D EPLOY WAR FILE This simply drop the file under webapps dir of tomcat.