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.

Slides:



Advertisements
Similar presentations
WEB SERVICES. FIRST AND FOREMOST - LINKS Tomcat AXIS2 -
Advertisements

Technology Overview JAVA Servlets CS-611 S. Witherspoon.
DT228/3 Web Development Introduction to Java Server Pages (JSP)
MC365 Application Servers: Servlets. Today We Will Cover: What a servlet is The HTTPServlet and some of its more important methods How to configure the.
Object-Oriented Enterprise Application Development Tomcat 3.2 Configuration Last Updated: 03/30/2001.
Application Servers What is it? General A set of software frameworks, components, utilities, functionality that enables you to develop and deliver n-tiered.
WEB1P servintro1 Introduction to servlets and JSP Dr Jim Briggs.
Configuring web servers and web applications 1. 2 Server configuration vs. application configuration A web server may run several web application Server.
1 Running Web Applications with Tomcat CS , Winter 2007/8.
Java 2 – Enterprise Edition Kevin J. LaFata April 21, 2003 UM – St. Louis.
1 Build a Web Application on J2EE. 2 J2EE Scenario Client – Web Server – EIS Resources Client – Web Server – EIS Resources Client – Application Server.
1 Dickson K.W. Chiu PhD, SMIEEE Reference: Sun J2EE 1.4 Tutorial CSIT600b: XML Programming XML Programming Guide: Getting Started.
Objectives:1. Investigate the Web application deployment descriptor 2. Install and deploy Tomcat and struts 3. Design and deploy a struts application Struts.
Java Server and Servlet CS616 Team 9 Kim Doyle, Susan Kroha, Arunima Palchowdhury, Wei Xu.
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.
Session-01. What is a Servlet? Servlet can be described in many ways, depending on the context: 1.Servlet is a technology i.e. used to create web application.
Session-02.
Web Applications Basics. Introduction to Web Web features Clent/Server HTTP HyperText Markup Language URL addresses Web server - a computer program that.
Java Servlets and JSP.
Gayle J Yaverbaum, PhD Professor of Information Systems Penn State Harrisburg.
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.
Java Server Pages B.Ramamurthy. Topics for Discussion 8/20/20152 Inheritance and Polymorphism Develop an example for inheritance and polymorphism JSP.
Apache Tomcat Web Server SNU OOPSLA Lab. October 2005.
Ing. Ignacio Roqueta ARTech GeneXus and J2EE.
Apache Tomcat Representation and Management of Data on the Web.
1 CS6320 – Deployment and Context L. Grewe 2 The Servlet Container Servlets run in a container sometimes called the Servlet engine. Servlets run in a.
SchwartzGBIF Nodes III29 April 2003 DiGIR Portal Installation And Configuration.
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.
CS-4220 Dr. Mark L. Hornick1 Servlet configuration and deployment.
CMPUT 391 – Database Management Systems Department of Computing Science University of Alberta CMPUT 391 Database Management Systems Web based Applications,
Web Server Programming 1. Nuts and Bolts. Premises of Course Provides general introduction, no in-depth training Assumes some HTML knowledge Assumes some.
Java Servlets & Java Server Pages Lecture July 2013.
Java Servlets Lec 27. Creating a Simple Web Application in Tomcat.
Chapter 2 Web app architecture. High-level web app architecture  When a client request coming in and needs servlet to serve dynamic web content, what.
@2008 Huynh Ngoc Tin Chapter #2 JAVA SERVLET PRGRAMMING.
Deploying a service. Talk titledate2 Talk titledate3 Section SOAP Deployment.
Servlets.
CS320 Web and Internet Programming Introduction to Java Servlets Chengyu Sun California State University, Los Angeles.
CSI 3125, Preliminaries, page 1 SERVLET. CSI 3125, Preliminaries, page 2 SERVLET A servlet is a server-side software program, written in Java code, that.
Advanced Java Session 6 New York University School of Continuing and Professional Studies.
Modern Programming Language. Web Container & Web Applications Web applications are server side applications The most essential requirement.
HTTP protocol Java Servlets. HTTP protocol Web system communicates with end-user via HTTP protocol HTTP protocol methods: GET, POST, HEAD, PUT, OPTIONS,
Java Programming: Advanced Topics 1 Building Web Applications Chapter 13.
1 Lecture 8 George Koutsogiannakis/Summer 2011 CS441 CURRENT TOPICS IN PROGRAMMING LANGUAGES.
BlueDragon Editions and Advantages Lori Pacheco New Atlanta.
1 Web Programming with Servlets & JSPs WEB APPLICATIONS – AN OVERVIEW.
CS320 Web and Internet Programming Introduction to Java Servlets Chengyu Sun California State University, Los Angeles.
APACHE TOMCAT WEB SERVER
CS3220 Web and Internet Programming Introduction to Java Servlets
Servlets.
Java Servlets By: Tejashri Udavant..
CSE 403: Servlet Technology
Course Outcomes of Advanced Java Programming AJP (17625, C603)
Introduction to Java Servlets on Jakarta Tomcat
MSIS 655 Advanced Business Applications Programming
Chapter 26 Servlets.
J2EE Application Development
Jagdish Gangolly State University of New York at Albany
Introduction to JBoss application server
Objectives In this lesson you will learn about: Need for servlets
COP 4610L: Applications in the Enterprise Spring 2005
Java Servlets and JSP.
CS3220 Web and Internet Programming Introduction to Java Servlets
Installing Tomcat.
Introduction to Java Servlets
Java Chapter 7 (Estifanos Tilahun Mihret--Tech with Estif)
Presentation transcript:

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 –in the myapp directory create a directory called “Web-inf” in Web-inf create –classes –jsp –lib - use this for common things like JDBC drivers –sessions these directories are used for the various components of your application –when invoking your servlet the “magic name” myapp/setvlet will really refer to –c:docs/apps/myapp/Web-inf/classes

Deploying your application To deploy a servlet based application create a.war (web archive) file containing all of the files needed for the application and place it on the server the servlet container will work from the web archive extracting files as needed –the base JVM has all of the classes it needed for working with files in the various versions of zipped files. Use the JDK JAR utility to create your.war file –ex cd myapp; jar -cvf myapp.war (make sure that …JDKnnn/bin is in your path and all of the files in the current directory will be placed into the file myapp.war –copy the.war file to the webapp directory of your server and its work –make sure to back-up both your development directory and your deployed war file.

Servlet Life A servlet can come into existence for two reasons: –it was configured to be loaded on start-up of the servlet engine –a user request called for it a servlet object is created on the main thread init( ) is started on a secondary thread –the servlets init( ) method is guaranteed to be called once (and only once) for the life of a given servlet. –init( ) is guaranteed to complete before any service methods are invoked. the main thread for the servlet will terminate at the end of the init( ) when a request for the servlet is received the servlet engine spawns a new thread and calls the appropriate service( ) method –in the case of http this will be: doGet doPost doDelete doOptions doPut doTrace

Servlet Life (more) Once the servlets life cycle us up (when all associated threads quiesce) the destroy( ) method will automatically be run

Servlet APIs The servlet APIs are split into two packages: –javax.servlet contains classes and interfaces that implement generic, protocol independent servlets, having this generiv layer allows it to be extended other protocols (like IIOP) –javax.servlet.http extends javax.servlet for the HTTP protocol –javax implies it is an official java extension TOMCAT is the official reference implementation

Scope

J2EE Application Servers Tomcat – Apache Foundation – Open Source JRUN – Macromedia WebSphere – IBM BEA Weblogic – BEA Sun Java System Application Server – SUN Oracle Application Server – Oracle Corp.

Deployment Tomcat v.4 (Apache Foundation, Jakarta Project) –Implements the Servlet 2.3 and JSP 1.2 Specifications Servlet 2.3 Specification –Outlines requirements for deploying servlets Directory Structure Deployment Descriptors

Directory Structure /application /application/WEB-INF –Web.xml (deployment Descriptor) /application/WEB-INF/classes –Compiled class files –May be a WAR (Web Archive file containing all class files); create using the JAR application found in the JSDK bin directory

Deployment Descriptors XML file describing the application –Used by the server to deploy the application –DTD is at java.sun.con/j2ee/dtds/web-app_2_2.dtd

Web.xml (sample) CS422Sample Steflik’s Sample App for CS422 BrowserDataServlet BrowserDataServlet /steflik/BrowserDataServlet

Web Application Archive files jar cvf mywebapp.war