Standalone Java Application vs. Java Web Application

Slides:



Advertisements
Similar presentations
Copyright © 2008 Pearson Education, Inc. Publishing as Pearson Addison-Wesley Chapter 10 Servlets and Java Server Pages.
Advertisements

7 Copyright © 2005, Oracle. All rights reserved. Maintaining State in J2EE Applications.
4 Copyright © 2005, Oracle. All rights reserved. Creating the Web Tier: Servlets.
Web Development with Karsten Schulz Terp-Nielsen Master Principal Sales Consultant Oracle Denmark.
Apache Struts Technology
 Copyright Wipro Technologies JSP Ver 1.0 Page 1 Talent Transformation Java Server Pages.
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.
JDBC Dr Jim Briggs. WEBP JDBC2 JDBC Java Database Connectivity An API for connecting Java programs (applications, applets and servlets) to databases Largely.
WEB1P servintro1 Introduction to servlets and JSP Dr Jim Briggs.
Struts Basics SSE USTC Qing Ding. Agenda What is and Why Struts? Struts architecture – Controller: Focus of this presentation – Model – View Struts tag.
Core Servlets Chapter 3 Link for Core Servlets code: om/archive/ om/archive/
MC365 Application Servers: Java Server Pages (JSP’s) and Session Management.
1 Java Server Pages Can web pages be created specially for each user? What part does Java play?
Servlet details Russell Beale. Servlet lifecycle The servlet container creates only one instance of each servlet Each use request handled with a separate.
Apache Struts Technology A MVC Framework for Java Web Applications.
Indy Java User’s Group March 27, 2001 Sallie Mae 6:00p.m.
Web Applications Basics. Introduction to Web Web features Clent/Server HTTP HyperText Markup Language URL addresses Web server - a computer program that.
Servlets Life Cycle. The Servlet Life Cycle A servlet life cycle can be defined as the entire process from its creation till the destruction. The following.
SE-2840 Dr. Mark L. Hornick1 Java Servlet-based web apps Servlet Architecture.
Introduction to Java web programming Dr Jim Briggs JWP intro1.
Struts. Agenda Preface Struts and its components An example The architecture required for Struts Applications.
UNIT-V The MVC architecture and Struts Framework.
M. Taimoor Khan * Java Server Pages (JSP) is a server-side programming technology that enables the creation of dynamic,
Using JavaBeans and Custom Tags in JSP Lesson 3B / Slide 1 of 37 J2EE Web Components Pre-assessment Questions 1.The _____________ attribute of a JSP page.
AN OVERVIEW OF SERVLET TECHNOLOGY SERVER SETUP AND CONFIGURATION WEB APPLICATION STRUCTURE BASIC SERVLET EXAMPLE Java Servlets - Compiled By Nitin Pai.
Chapter 17 - Deploying Java Applications on the Web1 Chapter 17 Deploying Java Applications on the Web.
Java support for WWW Babak Esfandiari (sources: Qusay Mahmoud, Roger Impey, textbook)
Design Patterns Phil Smith 28 th November Design Patterns There are many ways to produce content via Servlets and JSPs Understanding the good, the.
Chapter 5 Java Servlets. Objectives Explain the nature of a servlet and its operation Use the appropriate servlet methods in a web application Code the.
COMP 321 Week 7. Overview HTML and HTTP Basics Dynamic Web Content ServletsMVC Tomcat in Eclipse Demonstration Lab 7-1 Introduction.
CS4273: Distributed System Technologies and Programming Lecture 13: Review.
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.
Java Servlets example using NetBeans 6. Pre-requirements: Install Java JDK 1.6 Install NetBeans IDE 6 (we will use version NetBeans IDE update 16)
Struts J2EE web application framework “ Model 2 ” Model View Controller Controller Servlet Key features XML metadata Struts taglib Simplified form validation.
Lecturer: Prof. Piero Fraternali, Teaching Assistant: Alessandro Bozzon, Advanced Web Technologies: Struts–
Chapter 3 Servlet Basics. 1.Recall the Servlet Role 2.Basic Servlet Structure 3.A simple servlet that generates plain text 4.A servlet that generates.
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.
Chapter 6 Server-side Programming: Java Servlets
_______________________________________________________________________________________________________________ E-Commerce: Fundamentals and Applications1.
Input Validation – common associated risks  ______________ user input controls SQL statements ultimately executed by a database server
Java Server Pages (JSP)
CSCI 6962: Server-side Design and Programming Java Server Faces Scoping and Session Handling.
Enterprise Java Beans. Model 1 J2EE – Web View Model/View/Controller Model View Control Data base Web Server Model One Architecture HTTP Request HTTP.
Copyright © 2012 UNICOM Systems, Inc. Confidential Information z/Ware Product Overview illustro Systems International A Division of UNICOM Global.
Server-side Programming The combination of –HTML –JavaScript –DOM is sometimes referred to as Dynamic HTML (DHTML) Web pages that include scripting are.
Philip Repsher October 29 th, 2008 Or Maybe November 3 rd, 2008.
Middleware 3/29/2001 Kang, Seungwoo Lee, Jinwon. Description of Topics 1. CGI, Servlets, JSPs 2. Sessions/Cookies 3. Database Connection(JDBC, Connection.
CSI 3125, Preliminaries, page 1 SERVLET. CSI 3125, Preliminaries, page 2 SERVLET A servlet is a server-side software program, Responds oriented other.
What is a Servlet? Java Program that runs in a Java web server and conforms to the servlet api. A program that uses class library that decodes and encodes.
Introduction to Servlets Allen Day. Notes This is a training NOT a presentation Please ask questions Prerequisites.
© FPT SOFTWARE – TRAINING MATERIAL – Internal use 04e-BM/NS/HDCV/FSOFT v2/3 JSP Application Models.
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.
CSC 2720 Building Web Applications Basic Frameworks for Building Dynamic Web Sites / Web Applications.
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.
APACHE STRUTS ASHISH SINGH TOMAR ast2124. OUTLINE Introduction The Model-View-Controller Design Pattern Struts’ implementation of the MVC Pattern Additional.
SDJ INFOSOFT PVT. LTD. 2 BROWSERBROWSER JSP JavaBean DB Req Res Application Layer Enterprise server/Data Sources.
Apache Struts Technology A MVC Framework for Java Web Applications.
2 Copyright © 2004, Oracle. All rights reserved. Running a Forms Developer Application.
CS 562 Advanced Java and Internet Application Computer Warehouse Web Application By Team Alpha :-  Puja Mehta (102163)  Mona Nagpure (102147)
Running a Forms Developer Application
z/Ware 2.0 Technical Overview
Java Servlets By: Tejashri Udavant..
Play Framework: Introduction
Java Servlets.
Unit 6-Chapter 2 Struts.
The Model Layer What is Model?
Objectives In this lesson you will learn about: Need for servlets
Struts BY: Tejashri Udavant..
Presentation transcript:

Standalone Java Application vs. Java Web Application A class that contains a main() method must be the initial class invoked for a standalone application. Invoked with the java command, which automatically calls the main() method. Does not have to be invoked within a special environment. Java web application Servlets are the initial classes invoked for Java web applications. Servlets are Java classes that extend the Servlet class. They contain methods that correspond to HTTP request types such as doGet() and doPost(), and their initial method is service() rather than main(). Invoked in a special environment called a servlet container which is part of a web app server. Upon receipt of an HTTP request, the container automatically calls the proper method that corresponds to the type of HTTP request received. When an application framework is used, the framework provides the servlets that handle the initial receipt of HTTP requests, so developers only write normal Java classes and JSPs.

Standalone Java Application Environment OS/400 Java Runtime Environment Library (JRE) Java Virtual Machine (JVM) Java Application

Java Web Application Environment OS/400 JRE Library Http Server JVM J2EE Application Server Java Servlet v2.3 Container Web App Web App Web App Multi-user User authorization and access control Maintain session state via cookies or URL rewriting Multi-tasking Time-slice control Resource pool management Threads Class instances SQL prepared statements Database connections

Configuring Web Applications On The Server There can be multiple web applications installed on the same application server. Each has a unique name (application context): GlazerWeb AllianceReports AllianceUserMaint diveport GlazerTest Each has a configuration file (web.xml): Specifies the index (initial) page Specifies mappings of URL requests to servlets One URL to one servlet Group of URLs to one servlet

Java Application Frameworks An application framework provides: Process flow control (MVC) Helper processes (instantiate and auto-populate classes and beans, and populate and extract data for html page fields) Functional processes (validation, database access) Configuring a web application that uses a framework: In the web application configuration file (web.xml), all requests map to the framework controller servlet so the framework can control the flow. Each application requires additional configuration files to specify the desired behavior of the framework. Configuration file for application framework Requested URL Classes Form View Validation Error View Auxiliary 1 Auxiliary x Controller Success View promptForm ClassA ClassB ClassA ClassD ClassE ClassF detailForm detailForm ClassA ClassB ClassA ClassD ClassE ClassF promptForm

Web Application Flow (using an MVC framework) Request arrives at HTTP server. HTTP server routes the request to the application server. Based on the application context, the requested URL is compared to the configuration file for the application and the request is passed to the specified servlet (the framework controller). Framework controller looks up the entry for the requested URL in the framework configuration file for the application, and based on the configuration parameters: Request is passed to the form view class after executing any helper classes and instantiating any beans. View class creates and sends response to the user. User sends reply request. Based on the session id cookie, the server associates the request to the existing session for the user. Framework populates a bean with the input data from the request. Framework executes validation class. If validation errors, framework: Returns the input data and all errors to the form view class. If no validation errors, framework: Instantiates and populates any helper classes and beans. Passes the request to the controller class for the requested URL. At end of controller class execution, the request is passed to the success view class. Success view class creates and sends response to the user.