Web Applications Basics. Introduction to Web Web features Clent/Server HTTP HyperText Markup Language URL addresses Web server - a computer program that.

Slides:



Advertisements
Similar presentations
6/2/2015Page 1 SOA Development and Deployment B. Ramamurthy.
Advertisements

Object-Oriented Enterprise Application Development Tomcat 3.2 Configuration Last Updated: 03/30/2001.
WEB1P servintro1 Introduction to servlets and JSP Dr Jim Briggs.
An introduction to Java Servlet Programming
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.
Apache Tomcat Server Typical html Request/Response cycle
J2EE Java 2 Enterprise Edition. Relevant Topics in The Java Tutorial Topic Web Page JDBC orial/jdbc
Java Server Team 8. Overview What is a Java Server? History Architecture Advantages Disadvantages Current Technologies Conclusion.
Objectives:1. Investigate the Web application deployment descriptor 2. Install and deploy Tomcat and struts 3. Design and deploy a struts application Struts.
{ Apache - Click By, By, Anupam Mundale. Anupam Mundale. Viraj Kulkarni. Viraj Kulkarni.
Tomcat Configuration A Very, Very, Very Brief Overview.
Coypright (c) Ning Chen, Ph.D CPSC 425 Java Enterprise Application Programming Presented by Ning Chen, Ph.D. Chair/Professor Department of Computer.
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.
Java Servlets and JSP.
Apache Jakarta Tomcat Suh, Junho. Road Map Tomcat Overview Tomcat Overview History History What is Tomcat? What is Tomcat? Servlet Container.
Java Enterprise Edition Java Web Development Structure of a web project Introduction to Web Applications The first project Introduction to Java Web Development.
UNIT-V The MVC architecture and Struts Framework.
Linux Operations and Administration
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,
Distributed Multitiered Applications The J2EE platform uses a multitiered distributed application model. Application logic is divided into components 1.
MAVEN-BLUEMARTINI Yannick Robin. What is maven-bluemartini?  maven-bluemartini is Maven archetypes for Blue Martini projects  Open source project on.
Notes of J2EE Tutorial Matt Tsai. 2 Outline Chapter 1: Overview Chapter 1: Overview Chapter 2: Understanding XML Chapter 2: Understanding XML Chapter.
© 2005 by IBM; made available under the EPL v1.0 | March 1, 2005 Tim deBoer Gorkem Ercan Extend WTP Server Tools for your.
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.
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.
Introduction to J2EE Architecture Portions by Kunal Mehta.
JBoss at Work JAW Motors Application Chapter 1-3 Jeff Schmitt October 9, 2006.
Java Server Pages A JSP page is a text-based document that contains two types of text: static template data, which can be expressed in any text-based format,
|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.
Lecturer: Prof. Piero Fraternali, Teaching Assistant: Alessandro Bozzon, Advanced Web Technologies: Struts–
JAVA SERVER PAGES CREATING DYNAMIC WEB PAGES USING JAVA James Faeldon CS 119 Enterprise Systems Programming.
J2EE Overview Web Programming CSCI J2EE multi-tier architecture Servlet: Java class loaded into Web server JSP page: enhanced HTML page that is.
Java Servlets & Java Server Pages Lecture July 2013.
Presentation: SOAP/WS in a distributed object framework, Application Servers & AXIS SOAP.
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.
Chính phủ điện tử TS. Phạm Văn Tính Khoa CNTT, ĐH Nông Lâm TP.HCM
JS (Java Servlets). Internet evolution [1] The internet Internet started of as a static content dispersal and delivery mechanism, where files residing.
CS320 Web and Internet Programming Introduction to Java Servlets Chengyu Sun California State University, Los Angeles.
COMP9321 Web Application Engineering Semester 2, 2015 Dr. Amin Beheshti Service Oriented Computing Group, CSE, UNSW Australia Week 3 1COMP9321, 15s2, Week.
Preface IIntroduction Objectives I-2 Course Overview I-3 1Oracle Application Development Framework Objectives 1-2 J2EE Platform 1-3 Benefits of the J2EE.
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,
NJIT 1 Apache Tomcat (Version 6.0) THETOPPERSWAY.COM.
Java Programming: Advanced Topics 1 Building Web Applications Chapter 13.
Java Server Pages. 2 Servlets The purpose of a servlet is to create a Web page in response to a client request Servlets are written in Java, with a little.
Topics to be covered (ni) Client side validation JSF (free tools as well) Webservices Tell Resources e.g. sites Packaging and deploying web applications.
Maven. Introduction Using Maven (I) – Installing the Maven plugin for Eclipse – Creating a Maven Project – Building the Project Understanding the POM.
CS520 Web Programming Introduction to Maven 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.
Java High level programming language ◦ Sun Microsystems ◦ ORACLE acquired Java Development Kit – JDK Java Runtime Environment – JRE Java Virtual Machine.
Speaker Name Speaker Title Speaker Title Oracle Corporation Olivier Le Diouris Principal Product Manager Oracle Corporation Building Servlet and JSP Applications.
Platform & Maven2 David Šimonek. Certified Engineer Course Agenda What is Maven? Why Maven? NB IDE & Maven NB Platform & Maven.
Java Servlets By: Tejashri Udavant..
Advanced Java Programming
Knowledge Byte In this section, you will learn about:
Introduction to Struts
MSIS 655 Advanced Business Applications Programming
J2EE Application Development
ESIS Consulting LLC (C) ESIS Consulting LLC. All rights reserved
Objectives In this lesson you will learn about: Need for servlets
J2EE Lecture 1:Servlet and JSP
Java Chapter 7 (Estifanos Tilahun Mihret--Tech with Estif)
Presentation transcript:

Web Applications Basics

Introduction to Web Web features Clent/Server HTTP HyperText Markup Language URL addresses Web server - a computer program that is responsible for accepting HTTP requests from clients and serving them HTTP responses Web application - a dynamic extension of a web or application server

Web Applications & Components Two types of web applications: Presentation-oriented (HTML, XML pages) Service-oriented (Web services) Web components provide the dynamic extension capabilities for a web server: Java servlets JSP pages Web service endpoints

Web Application Interaction [client] sends an HTTP request to the web server [web server] HTTP request  HTTPServletRequest This object is delivered to a web component, which can interact with JavaBeans or a DB to generate dynamic content [web component] generates an HTTPServletResponse or pass the request to another web component [web server] HTTPServletResponse  HTTP response [web server] returns HTTP response to the client

Web Application Interaction

Web Components Servlets - Java classes that dynamically process requests and construct responses JSP pages - text-based documents that execute as servlets but allow a more natural approach to creating static content Appropriate usage Servlets - service-oriented applications, control functions JSP - generating text-based markup (HTML, SVG, WML, XML)

Java Web Application Technologies Java Servlet technology is the foundation of all the web application technologies

Web Containers Web components are supported by the services of a runtime platform called a web container In J2EE, a web container "implements the web component contract of the J2EE architecture“ Web container services: request dispatching security concurrency life-cycle management naming, transactions, APIs

Web Container Examples Non-commercial Apache Tomcat Jetty Commertial Sun Java System Application Server BEA WebLogic Server Oracle Application Server WebSphere Open source JBoss

Deployment Web components have to be installed or deployed to the web container Aspects of web application behaviour can be configured during application deployment The configuration information is maintained in a XML file called a web application deployment descriptor

Web Application Development A web application consists of: Web components Static resource files (such as images) Helper classes and libraries The process for creating and running a web application is different from that of traditional stand-alone Java classes

Development Cycle 1.Develop the web component code 2.Develop the web application deployment descriptor 3.Compile the web application components and helper classes referenced by the components 4.Optionally package the application into a deployable unit 5.Deploy the application into a web container 6.Access a URL that references the web application

Web Modules According to Java EE architecture and Java Servlet Specification: Web components and static web content files such as images are called web resources A web module is the smallest deployable and usable unit of web resources Web module corresponds to a web application A web module has a specific structure

Web Module Structure The top-level directory of a web module is the document root of the application The document root contains: JSP pages client-side classes client-side archives static web resources

Web Module Structure The document root contains a subdirectory /WEB-INF/ web.xml: web application deployment descriptor lib: JAR archives of libraries called by server-side classes

Web Module Structure classes: server-side classes: servlets utility classes JavaBeans components tags: tag files, which are implementations of tag libraries

Configuring Web Applications Web applications are configured via /WEB-INF/web.xml file Configuration options: Map URLs to web components Set initialization parameters Map errors to error screens Declare welcome files Declare resource references

Mapping URLs to Web Components When a request is received by the web container it must determine which web component should handle the request Need to add a servlet definition and a servlet mapping for each servlet to web.xml file ServletName ServletClass ServletName /path

Initialization Parameters It's possible to pass initialization parameters to the context or to a web component Context parameters: name value Servlet parameters (within servlet definition): name value

Handling Errors Web container generates default error page You can specify custom default page to be displayed instead Steps to handle errors Create appropriate error html pages for error conditions Modify the web.xml accordingly

Example: Setting Error Pages exception.BookNotFoundException /errorpage1.html exception.BooksNotFoundException /errorpage2.html exception.OrderException /errorpage3.html

Example: web.xml Your team project name Team N servlets name_of_context_initialization_parameter value_of_context_initializtion_parameter YourServlet YourServletClass YourServlet /YourServlet

WAR Files A web module can be deployed as an unpacked file structure or can be packaged in a JAR file known as a Web Archive File WAR file can be created by: executing jar command using Ant target using IDE (Eclipse for instance) using Maven

Setting a Context Root A context root identifies a web application in a Java EE server The server is responsible for mapping URL’s that start with a specific prefix to the location of a web application Usually this is done with a web server configuration file

Using Maven & Jetty A convenient way to develop, build, deploy and run Web application is by using: Maven build tool Jetty web server

Creating Directory Structure Maven 2 supports the notion of creating a complete project template with a simple command To create Web project template need to use maven-archetype-webapp archetype mvn archetype:create -DgroupId=com.maven2example -DartifactId=maven2example_webapp -DarchetypeArtifactId=maven-archetype-webapp

Maven Web Directory Structure /src/main/webapp/ - directory structure for a WAR

Packaging Executing the command mvn package creates a WAR file

Running with Jetty It’s easy to run application by using Jetty plugin for Maven Jetty is an open-source, standards-based, full-featured web server implemented entirely in Java First created in 1995 Latest version / July 23, 2007

Running with Jetty Add the Jetty plugin to the pom.xml maven2example_webapp org.mortbay.jetty maven-jetty-plugin 6.0.1

Running with Jetty Execute mvn jetty:run command >mvn jetty:run [INFO] Scanning for projects... [INFO] Searching repository for plugin with prefix: 'jetty'. [INFO] [INFO] Building maven2example_webapp Maven Webapp [INFO] task-segment: [jetty:run] [INFO] [INFO] Starting jetty [INFO] Started Jetty Server Stop by Ctrl+C

Opening the Application Open your web browser to

Opening the Application Valid URL is

Resources J2EE Tutorial “Getting Started with Web applications” /bnadr.html Building Web Applications with Maven 2 uilding-web-applications-with-maven-2.html Filmiņa par Web 2 (5 minūtes)