Plateform for Enterprise Solution: Java EE5

Slides:



Advertisements
Similar presentations
3 Copyright © 2005, Oracle. All rights reserved. Designing J2EE Applications.
Advertisements

Lecture plan Information retrieval (from week 11)
COM vs. CORBA.
Apache Struts Technology
 Copyright Wipro Technologies JSP Ver 1.0 Page 1 Talent Transformation Java Server Pages.
Using JavaServer Pages Harry R. Erwin, PhD CIT304/CSE301.
Computer Monitoring System for EE Faculty By Yaroslav Ross And Denis Zakrevsky Supervisor: Viktor Kulikov.
Sapana Mehta (CS-6V81) Overview Of J2EE & JBoss Sapana Mehta.
28/1/2001 Seminar in Databases in the Internet Environment Introduction to J ava S erver P ages technology by Naomi Chen.
Outline IS400: Development of Business Applications on the Internet Fall 2004 Instructor: Dr. Boris Jukic Server Side Web Technologies: Part 2.
1 CS6320 – Why Servlets? L. Grewe 2 What is a Servlet? Servlets are Java programs that can be run dynamically from a Web Server Servlets are Java programs.
Application Architectures Vijayan Sugumaran Department of DIS Oakland University.
1 Java Server Pages Can web pages be created specially for each user? What part does Java play?
UNIT-V The MVC architecture and Struts Framework.
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.
©Ian Sommerville 2004Software Engineering, 7th edition. Chapter 13 Slide 1 Application architectures.
Windows.Net Programming Series Preview. Course Schedule CourseDate Microsoft.Net Fundamentals 01/13/2014 Microsoft Windows/Web Fundamentals 01/20/2014.
INTRODUCTION TO WEB DATABASE PROGRAMMING
JavaServer Faces: The Fundamentals Compiled from Sun TechDays workshops (JSF Basics, Web-Tier Codecamp: JavaServer Faces, Java Studio Creator; IBM RAD)
M. Taimoor Khan * Java Server Pages (JSP) is a server-side programming technology that enables the creation of dynamic,
Applets & Servlets.
FALL 2005CSI 4118 – UNIVERSITY OF OTTAWA1 Part 4 Web technologies: HTTP, CGI, PHP,Java applets)
CSCI 6962: Server-side Design and Programming Course Introduction and Overview.
Architecture Of ASP.NET. What is ASP?  Server-side scripting technology.  Files containing HTML and scripting code.  Access via HTTP requests.  Scripting.
Beyond DHTML So far we have seen and used: CGI programs (using Perl ) and SSI on server side Java Script, VB Script, CSS and DOM on client side. For some.
Chapter 16 The World Wide Web Chapter Goals Compare and contrast the Internet and the World Wide Web Describe general Web processing Describe several.
Java Omar Rana University of South Asia. Course Overview JAVA  C/C++ and JAVA Comparison  OOP in JAVA  Exception Handling  Streams  Graphics User.
第十四章 J2EE 入门 Introduction What is J2EE ?
J2EE Structure & Definitions Catie Welsh CSE 432
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.
Lecturer: Prof. Piero Fraternali, Teaching Assistant: Alessandro Bozzon, Advanced Web Technologies: Struts–
Webcommerce Computer Networks Webcommerce by Linnea Reppa Douglas Martindale Lev Shalevich.
WEB BASED DATA TRANSFORMATION USING XML, JAVA Group members: Darius Balarashti & Matt Smith.
1 Geospatial and Business Intelligence Jean-Sébastien Turcotte Executive VP San Francisco - April 2007 Streamlining web mapping applications.
Introducing ASP.NET 2.0. Internet Technologies WWW Architecture Web Server Client Server Request Response Network HTTP TCP/IP PC/Mac/Unix + Browser (IE,
Java Web Development with NetBeans IDE -- Kai Qian Chapter 5 JavaServer Faces (JSF) Technology.
1 MSCS 237 Overview of web technologies (A specific type of distributed systems)
Java Servlets and Java Server Pages Norman White Stern School of Business.
JS (Java Servlets). Internet evolution [1] The internet Internet started of as a static content dispersal and delivery mechanism, where files residing.
© 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.
Java – in context Main Features From Sun Microsystems ‘White Paper’
Java Servlets and Java Server Pages
Chapter 6 Chapter 6 Server Side Programming (JSP) Part 1 1 (IS 203) WebProgramming (IS 203) Web Programming.
Java Programming: Advanced Topics 1 Building Web Applications Chapter 13.
Bayu Priyambadha, S.Kom. Static content  Web Server delivers contents of a file (html) 1. Browser sends request to Web Server 3. Web Server sends HTML.
SDJ INFOSOFT PVT. LTD. 2 BROWSERBROWSER JSP JavaBean DB Req Res Application Layer Enterprise server/Data Sources.
World Wide Web has been created to share the text document across the world. In static web pages the requesting user has no ability to interact with the.
A Presentation Presentation On JSP On JSP & Online Shopping Cart Online Shopping Cart.
A S P. Outline  The introduction of ASP  Why we choose ASP  How ASP works  Basic syntax rule of ASP  ASP’S object model  Limitations of ASP  Summary.
Speaker Name Speaker Title Speaker Title Oracle Corporation Olivier Le Diouris Principal Product Manager Oracle Corporation Building Servlet and JSP Applications.
1 Chapter 1 INTRODUCTION TO WEB. 2 Objectives In this chapter, you will: Become familiar with the architecture of the World Wide Web Learn about communication.
The Holmes Platform and Applications
Java Server Pages Can web pages be created specially for each user?
J2EE Platform Overview (Application Architecture)
Servlets.
WWW and HTTP King Fahd University of Petroleum & Minerals
Haritha Dasari Josue Balandrano Coronel -
Processes The most important processes used in Web-based systems and their internal organization.
Unit 6-Chapter 2 Struts.
PHP / MySQL Introduction
MSIS 655 Advanced Business Applications Programming
Web Development Using ASP .NET
Chapter 27 WWW and HTTP.
Distributed System Using Java 2 Enterprise Edition (J2EE)
Lecture 1: Multi-tier Architecture Overview
Introduction to Servlets
Objectives In this lesson you will learn about: Need for servlets
JavaServer Faces: The Fundamentals
Presentation transcript:

Plateform for Enterprise Solution: Java EE5

Platform for Enterprise Solutions : JAVA EE5: What is Java EE ? JEE is actually a collection of technologies and APIs for the Java platform designed to support "Enterprise" Applications which can generally be classed as large-scale, distributed, transactional and highly-available applications designed to support mission-critical business requirements. In terms of what an employee is looking for in specific techs, it is quite hard to say, because the playing field has kept changing over the last five years. It really is about the class of problems that are being solved more than anything else. Transactions and distribution are key.

JAVA EE Platform Overview The Java EE platform is a set of standard specifications that describe application components, APIs, and the runtime containers and services of an application server. Java Platform, Enterprise Edition (Java EE) is the standard in community- driven enterprise software. Java EE is developed using the Java Community Process, with contributions from industry experts, commercial and open source organizations, Java User Groups, and countless individuals. Each release integrates new features that align with industry needs, improves application portability, and increases developer productivity. Today, Java EE offers a rich enterprise software platform, and with over 20 compliant Java EE implementations to choose from, low risk and plenty of options.

What's New As the industry begins the rapid adoption of Java EE 7, work has begun on Java EE 8. With a survey that received over 4,500 responses, the community has prioritized the desired features for Java EE 8. JSR 366 - Java EE 8 JSR 367 - The Java API for JSON Binding JSR 368 - Java Message Service 2.1 JSR 369 - Java Servlet 4.0 JSR 370 - Java API for RESTful Web Services 2.1 JSR 371 - Model-View-Controller 1.0 JSR 372 - Java Server Faces 2.3 JSR 373 - Java EE Management API 1.0 JSR 374 - Java API for JSON Processing 1.1 JSR 375 - Java EE Security API 1.0

Web core technologies: Servlets and JSP What is the difference between JSF, Servlet and JSP ? Servlet is html in java JSP is java in html JavaServer Faces (JSF) is a Java specification for building component-based user interfaces for web applications. It was formalized as a standard through the Java Community Process and is part of the JavaPlatform, Enterprise Edition.

Java Server Faces (JSF)

Java Server Faces (JSF) Java Server Faces (JSF) is a Java-based web application framework intended to simplify development integration of web-based user interfaces. Java Server Faces is a standardized display technology which was formalized in a specification through the Java Community Process. Before proceeding with this we should have a basic understanding of Java programming language, text editor and execution of programs etc. Because we are going to develop web based applications using JSF, so it will be good if we have understanding on other web technologies like, HTML, CSS, AJAX etc.

What is JSF? JSF is a MVC web framework that simplifies the construction of user interfaces (UI) for server-based applications by using reusable UI components in a page. JSF provides facility to connect UI widgets with data sources and to server-side event handlers. The JSF specification defines a set of standard UI components and provides an Application Programming Interface (API) for developing components. JSF enables the reuse and extension of the existing standard UI components.

JSF Benefits providing reusable UI components making easy data transfer between UI components managing UI state across multiple server requests enabling implementation of custom components wiring client side event to server side application code JSF reduces the effort in creating and maintaining applications which will run on a Java application server and will render application UI on to a target client

JSF UI component model Core library A set of base UI components - standard HTML input elements Extension of the base UI components to create additional UI component libraries or to extend existing components. Multiple rendering capabilities that enable JSF UI components to render themselves differently depending on the client types

What is MVC Design Pattern? Module Description Model Carries Data and login View Shows User Interface Controller Handles processing of an application

JSF Architecture JavaBeans components as models containing application-specific functionality and data A custom tag library for representing event handlers and validators A custom tag library for rendering UI components UI components represented as stateful objects on the server Server-side helper classes Validators, event handlers, and navigation handlers Application configuration resource file for configuring application resources

JSF - Life Cycle Restore view phase Apply request values phase; process events Process validations phase; process events Update model values phase; process events Invoke application phase; process events Render response phase

Servlets

Servlets Servlets provide a component-based, platform- independent method for building Web-based applications, without the performance limitations of CGI programs. Servlets have access to the entire family of Java APIs, including the JDBC API to access enterprise databases.

What are Servlets? Java Servlets are programs that run on a Web or Application server and act as a middle layer between a request coming from a Web browser or other HTTP client and databases or applications on the HTTP server. Using Servlets, we can collect input from users through web page forms, present records from a database or another source, and create web pages dynamically. I assume you have good understanding of the Java programming language. It will be great if you have a basic understanding of web application and how internet works.

Servlets advantages in comparison with the CGI Performance is significantly better. Servlets execute within the address space of a Web server. It is not necessary to create a separate process to handle each client request. Servlets are platform-independent because they are written in Java. Java security manager on the server enforces a set of restrictions to protect the resources on a server machine. So servlets are trusted. The full functionality of the Java class libraries is available to a servlet. It can communicate with applets, databases, or other software via the sockets and RMI mechanisms that you have seen already. Common Gateway Interface (CGI) The Java Remote Method Invocation (RMI) system allows an object running in one Java virtual machine to invoke methods on an object running in another Java virtual machine. RMI provides for remote communication between programs written in the Java programming language.

Servlets Architecture

Servlets Tasks Read the explicit data sent by the clients (browsers). This includes an HTML form on a Web page or it could also come from an applet or a custom HTTP client program. Read the implicit HTTP request data sent by the clients (browsers). This includes cookies, media types and compression schemes the browser understands, and so forth. Process the data and generate the results. This process may require talking to a database, executing an RMI or CORBA call, invoking a Web service, or computing the response directly. Send the explicit data (i.e., the document) to the clients (browsers). This document can be sent in a variety of formats, including text (HTML or XML), binary (GIF images), Excel, etc. Send the implicit HTTP response to the clients (browsers). This includes telling the browsers or other clients what type of document is being returned (e.g., HTML), setting cookies and caching parameters, and other such tasks. Object Request Broker (ORB) Common Object Request Broker Architecture (CORBA) technology is the open standard for heterogeneous computing. CORBA complements the Java™ platform by providing a distributed object framework, services to support that framework, and interoperability with other languages. The Java platform complements CORBA by providing a portable, highly productive implementation environment, and a very robust platform. By combining the Java platform with CORBA and other key enterprise technologies, the Java Platform is the ultimate platform for distributed technology solutions.

Servlets Packages Java Servlets are Java classes run by a web server that has an interpreter that supports the Java Servlet specification. Servlets can be created using the javax.servlet and javax.servlet.http packages, which are a standard part of the Java's enterprise edition, an expanded version of the Java class library that supports large-scale development projects.

Servlet Development environment setup Setting up Java Development Kit You Guise are master in it.

Servlet life cycle It is initialized by calling the init () method. It calls service() method to process a client's request. It is terminated by calling the destroy() method. Finally, it is garbage collected by the garbage collector of the JVM.

Architecture Diagram 1- First the HTTP requests coming to the server are delegated to the servlet container. 2- The servlet container loads the servlet before invoking the service() method. 3- Then the servlet container handles multiple requests by spawning multiple threads, each thread executing the service() method of a single instance of the servlet.

Servlets Form Data Client Request Server Response Http Codes Writing Filters Exceptions Cookies Handling Session Tracking Database Access File Uploading Handling Date Page Redirect Hits Counter Auto Refresh Sending Email Packaging Debugging Internationalization Internationalization: This means enabling a web site to provide different versions of content translated into the visitor's language or nationality. Localization: This means adding resources to a web site to adapt it to a particular geographical or cultural region for example Hindi translation to a web site. locale: This is a particular cultural or geographical region. It is usually referred to as a language symbol followed by a country symbol which is separated by an underscore. For example "en_US" represents english locale for US.

JSP

JSP Java Server Pages (JSP) is a server-side programming technology that enables the creation of dynamic, platform-independent method for building Web-based applications. JSP have access to the entire family of Java APIs, including the JDBC API to access enterprise databases.

What is Java Server Pages? Java Server Pages (JSP) is a technology for developing web pages that support dynamic content which helps developers insert java code in HTML pages by making use of special JSP tags, most of which start with <% and end with %>. A Java Server Pages component is a type of Java servlet that is designed to fulfill the role of a user interface for a Java web application.

Why Use JSP? Performance is significantly better because JSP allows embedding Dynamic Elements in HTML Pages itself instead of having a separate CGI files. JSP are always compiled before it's processed by the server unlike CGI/Perl which requires the server to load an interpreter and the target script each time the page is requested. Java Server Pages are built on top of the Java Servlets API, so like Servlets, JSP also has access to all the powerful Enterprise Java APIs, including JDBC, JNDI, EJB, JAXP etc. JSP pages can be used in combination with servlets that handle the business logic, the model supported by Java servlet template engines. Java Server Pages often serve the same purpose as programs implemented using the Common Gateway Interface (CGI). But JSP offer several advantages in comparison with the CGI.

Advantages of JSP vs. Active Server Pages (ASP): The advantages of JSP are twofold. First, the dynamic part is written in Java, not Visual Basic or other MS specific language, so it is more powerful and easier to use. Second, it is portable to other operating systems and non-Microsoft Web servers. vs. Pure Servlets: It is more convenient to write (and to modify!) regular HTML than to have plenty of println statements that generate the HTML.

Advantages of JSP vs. Server-Side Includes (SSI): SSI is really only intended for simple inclusions, not for "real" programs that use form data, make database connections, and the like. vs. JavaScript: JavaScript can generate HTML dynamically on the client but can hardly interact with the web server to perform complex tasks like database access and image processing etc. vs. Static HTML: Regular HTML, of course, cannot contain dynamic information.

JSP - Architecture A JSP container works with the Web server to provide the runtime environment and other services a JSP needs. It knows how to understand the special elements that are part of JSPs.

JSP Processing The following steps explain how the web server creates the web page using JSP: As with a normal page, our browser sends an HTTP request to the web server. The web server recognizes that the HTTP request is for a JSP page and forwards it to a JSP engine. This is done by using the URL or JSP page which ends with .jsp instead of .html. The JSP engine loads the JSP page from disk and converts it into a servlet content. This conversion is very simple in which all template text is converted to println( ) statements and all JSP elements are converted to Java code that implements the corresponding dynamic behavior of the page. The JSP engine compiles the servlet into an executable class and forwards the original request to a servlet engine. A part of the web server called the servlet engine loads the Servlet class and executes it. During execution, the servlet produces an output in HTML format, which the servlet engine passes to the web server inside an HTTP response. The web server forwards the HTTP response to our browser in terms of static HTML content. Finally web browser handles the dynamically generated HTML page inside the HTTP response exactly as if it were a static page.

JSP - Life Cycle Compilation Initialization Execution Cleanup A JSP life cycle can be defined as the entire process from its creation till the destruction which is similar to a servlet life cycle with an additional step which is required to compile a JSP into servlet.

JSP - Life Cycle A JSP life cycle can be defined as the entire process from its creation till the destruction which is similar to a servlet life cycle with an additional step which is required to compile a JSP into servlet.

The compilation process involves three steps: Parsing the JSP. JSP Compilation The compilation process involves three steps: Parsing the JSP. Turning the JSP into a servlet. Compiling the servlet. When a browser asks for a JSP, the JSP engine first checks to see whether it needs to compile the page. If the page has never been compiled, or if the JSP has been modified since it was last compiled, the JSP engine compiles the page.

JSF, Servlet and JSP JSP is a webpage scripting language that can generate dynamic content while Servlets are Java programs that are already compiled which also creates dynamic web content Servlets run faster compared to JSP JSP can be compiled into Java Servlets It’s easier to code in JSP than in Java Servlets In MVC, JSP act as a view and servlet act as a controller. JSP are generally preferred when there is not much processing of data required. But servlets are best for use when there is more processing and manipulation involved. The advantage of JSP programming over servlets is that we can build custom tags which can directly call Java beans. There is no such facility in servlets. We can achieve functionality of JSP at client side by running JavaScript at client side. There are no such methods for servlets.