Introduction to JSP and Servlets Training 5-days

Similar documents
Fast Track to Java EE 5 with Servlets, JSP & JDBC

Fast Track to Java EE

This course is intended for Java programmers who wish to write programs using many of the advanced Java features.

112-WL. Introduction to JSP with WebLogic

112. Introduction to JSP

ADVANCED JAVA TRAINING IN BANGALORE

Advance Java. Configuring and Getting Servlet Init Parameters per servlet

Oracle 10g: Build J2EE Applications

Java- EE Web Application Development with Enterprise JavaBeans and Web Services

J2EE Development. Course Detail: Audience. Duration. Course Abstract. Course Objectives. Course Topics. Class Format.

Table of Contents. Introduction... xxi

Database. Request Class. jdbc. Servlet. Result Bean. Response JSP. JSP and Servlets. A Comprehensive Study. Mahesh P. Matha

JSP MOCK TEST JSP MOCK TEST IV

Writing Servlets and JSPs p. 1 Writing a Servlet p. 1 Writing a JSP p. 7 Compiling a Servlet p. 10 Packaging Servlets and JSPs p.

ADVANCED JAVA COURSE CURRICULUM

1Z Java EE 6 Web Component Developer Certified Expert Exam Summary Syllabus Questions

Type of Classes Nested Classes Inner Classes Local and Anonymous Inner Classes

Contents at a Glance

Chapter 10 Servlets and Java Server Pages

Java J Course Outline

Specialized - Mastering JEE 7 Web Application Development

Table of Contents Fast Track to Java EE 5 with Servlets/JSP and JDBC

Introduction to Web Application Development Using JEE, Frameworks, Web Services and AJAX

ive JAVA EE C u r r i c u l u m

COMP9321 Web Application Engineering

Call us: /

LearningPatterns, Inc. Courseware Student Guide

Unit 5 JSP (Java Server Pages)

DVS WEB INFOTECH DEVELOPMENT TRAINING RESEARCH CENTER

AN ISO 9001:2008 CERTIFIED COMPANY ADVANCED. Java TRAINING.

JAVA MICROSERVICES. Java Language Environment. Java Set Up. Java Fundamentals. Packages. Operations

Developing Applications with Java EE 6 on WebLogic Server 12c

a. Jdbc:ids://localhost:12/conn?dsn=dbsysdsn 21. What is the Type IV Driver URL? a. 22.

JAVA 2 ENTERPRISE EDITION (J2EE)

Watch Core Java and Advanced Java Demo Video Here:

COMP9321 Web Application Engineering

Java EE Application Assembly & Deployment Packaging Applications, Java EE modules. Model View Controller (MVC)2 Architecture & Packaging EJB Module

Oracle - Developing Applications for the Java EE 7 Platform Ed 1 (Training On Demand)

PSD1B Advance Java Programming Unit : I-V. PSD1B- Advance Java Programming

Introduction... xv SECTION 1: DEVELOPING DESKTOP APPLICATIONS USING JAVA Chapter 1: Getting Started with Java... 1

COMP9321 Web Application Engineering

What's New in the Servlet and JSP Specifications

COMP9321 Web Application Engineering

Introduction to J2EE...xxvii. Chapter 1: Introducing J2EE... 1 Need for Enterprise Programming... 3 The J2EE Advantage... 5

LTBP INDUSTRIAL TRAINING INSTITUTE

Courses For Event Java Advanced Summer Training 2018

JavaServer Pages. What is JavaServer Pages?

Course Content for Java J2EE

Module 5 Developing with JavaServer Pages Technology

GUJARAT TECHNOLOGICAL UNIVERSITY

Java EE 7: Back-End Server Application Development

Java.. servlets and. murach's TRAINING & REFERENCE 2ND EDITION. Joel Murach Andrea Steelman. IlB MIKE MURACH & ASSOCIATES, INC.

HttpServlet ( Class ) -- we will extend this class to handle GET / PUT HTTP requests

Java 2 Platform, Enterprise Edition: Platform and Component Specifications

COMP9321 Web Application Engineering

Peers Techno log ies Pv t. L td. Core Java & Core Java &Adv Adv Java Java

LTBP INDUSTRIAL TRAINING INSTITUTE

JAVA COURSES. Empowering Innovation. DN InfoTech Pvt. Ltd. H-151, Sector 63, Noida, UP

web.xml Deployment Descriptor Elements

Ch04 JavaServer Pages (JSP)

Advanced Java Programming

Call: Core&Advanced Java Springframeworks Course Content:35-40hours Course Outline

1 CUSTOM TAG FUNDAMENTALS PREFACE... xiii. ACKNOWLEDGMENTS... xix. Using Custom Tags The JSP File 5. Defining Custom Tags The TLD 6

J2EE - Version: 25. Developing Enterprise Applications with J2EE Enterprise Technologies

Projects. How much new information can fit in your brain? Corporate Trainer s Profile TECHNOLOGIES

Java Programming Course Overview. Duration: 35 hours. Price: $900

Vision of J2EE. Why J2EE? Need for. J2EE Suite. J2EE Based Distributed Application Architecture Overview. Umair Javed 1

CO Java EE 7: Back-End Server Application Development

Advanced Java Programming SRM UNIVERSITY FACULTY OF SCIENCE AND HUMANITIES DEPARTMENT OF COMPUTER SCIENCE

COMP9321 Web Application Engineering

Web Application Development Using JEE, Enterprise JavaBeans and JPA

CS506 Web Design & Development Final Term Solved MCQs with Reference

Session 12. JSP Tag Library (JSTL) Reading & Reference

Java SE 8 Fundamentals

Servlet Fudamentals. Celsina Bignoli

AIM. 10 September

About the Authors. Who Should Read This Book. How This Book Is Organized

What's New in J2EE 1.4

/ / JAVA TRAINING

Distributed Multitiered Application

Oracle EXAM - 1Z Java Enterprise Edition 5 Web Component Developer Certified Professional Exam. Buy Full Product

JVA-117A. Spring-MVC Web Applications

Sun Sun Certified Web Component Developer for J2EE 5 Version 4.0

Module 3 Web Component

Java SE7 Fundamentals

Servlet and JSP: A Beginner's Tutorial First Edition

JSP. Common patterns

One application has servlet context(s).

A- Core Java Audience Prerequisites Approach Objectives 1. Introduction

114. Jakarta Struts. Prerequisites. Version 1.1.3

SSC - Web applications and development Introduction and Java Servlet (I)

Web Application Development Using JEE, Enterprise JavaBeans and JPA

UNIT -5. Java Server Page

J2EE Interview Questions

Questions and Answers

SNS COLLEGE OF ENGINEERING, Coimbatore

Page 1

JVA-163. Enterprise JavaBeans

Call: JSP Spring Hibernate Webservice Course Content:35-40hours Course Outline

COWLEY COLLEGE & Area Vocational Technical School

Transcription:

QWERTYUIOP{ Introduction to JSP and Servlets Training 5-days Introduction to JSP and Servlets training course develops skills in JavaServer Pages, or JSP, which is the standard means of authoring dynamic content for Web applications under the Java Enterprise platform. It treats JSP 2.0, including older features such as scriptlets but focusing on newer features and techniques, including JSP expressions and the JSTL. This course develops the important concept of the separation of programmatic and declarative development: use of configuration and context information in lieu of hard-coded values, resource locations, etc., to make the Web application as portable and easy to administer as possible. The course introduces JavaBeans as a standard for business and data objects that can be shared among servlets and JSPs, and develops techniques for sharing such objects at session scope or by request forwarding. Finally, students learn how to implement filters to adapt existing servlets by preand post-processing the request and response. At the end of the course, students will be well prepared to author JSPs for small- or large-scale Web applications, either "by hand" (they use only a text editor in class) or using an authoring tool. The first module begins with an introduction of Web applications in general, shows how Java servlets and JSPs establish a framework for writing Web applications, and then covers JSP 2.0 features in detail, from scripting elements to use of dedicated JavaBeans to JSP expressions, and quick introductions of JSTL and custom tag development. By the end of the module students will be able to create their own JSP applications, including interactive applications using HTML forms and pages that perform fairly complex processing using scripts and or actions. Although scripting is covered, the scriptless authoring style encouraged by the JSP 2.0 specification is emphasized, and students will be well equipped to develop concise and effective JSP applications. The second module covers the JSTL, or JSP Standard Tag Library, actually a set of four custom tag libraries that establish a portable standard for common processing tasks in JSP. JSTL is a major part of the new scriptless authoring style encouraged (and enabled) by the JSP 2.0 specification. This module covers all four JSTL libraries in depth: The core actions, which support JSP expressions for JSP 1.x containers, flow control for procedural processing in JSPs, and resource access. The formatting and internationalization/localization actions, which standardize formatted numeric and date/time output as well as multi-language support. * The SQL actions, which dramatically simplify access to relational data from a JSP. The XML actions, which give JSPs a simple, powerful framework by which to parse, address and transform XML data using XPath and XSLT. Each individual tag in each library is covered, with precise syntactic rules shown in a standard format in the student guide, and JSTL techniques and best practices are discussed for each library. An extensive set of example applications illustrates common usage of each major group of actions, and the module culminates with a wrap-up workshop that brings core, SQL, and XML techniques to bear in a single application. JSP Training Learning Objectives Explain the fundamentals of HTML and HTTP in the World Wide Web. Describe JavaServer Pages and their relationship to servlets and J2EE generally. Describe how a JSP is translated into a servlet and processed at runtime. Explain the use of directives on JSPs and outline the principal directives. Implement simple JSPs that use Java code in declarations, expressions and scriptlets. Enumerate and use the implicit objects available to scripting elements.

Implement an interactive Web application using HTML forms and JSP. Use Java exception handling and JSP error pages to handle errors in JSP applications. Implement session management for a JSP application. Manage cookies to store client-specific information at various scopes and durations. Use JavaBeans to implement effective interactive JSP applications. Describe custom tags in JSP and explain how they are implemented, both using Java and JSP itself, and how they are used. Discuss threading issues in JSP and describe the use of directives to control how threading is handled. Describe the various uses of XML in JSP applications. Deploy a logical Web application to a Web server in a WAR file. Describe the use of the JSP expression language to simplify dynamic page output. Write JSP expressions and implement JSPs that use them in favor of scripts. Implement JSPs that use basic JSTL actions to simplify presentation logic. Decompose a JSP application design into fine-grained, reusable elements including JavaBeans, custom tag handlers and tag files that use JSTL. Use core JSTL actions to complement standard actions, custom actions, and JSP expressions for seamless, script-free page logic. Direct conditional and iterative processing of page content by looping through ranges of numbers, over elements in a collection, or over tokens in a master string. Set locale and time zone information in JSPs, and use them to correctly format numbers, dates and times for all clients. Use resource bundles to manage application strings, and produce the appropriate strings at runtime for a particular client locale. Locate a data source, query for relational data, and parse result sets. Perform updates, inserts and deletes on relational data using SQL actions. Manage queries and updates in transaction contexts. Derive information from parsed XML content using XPath expressions. Implement conditional processing and loops based on XML information. Apply XSLT transformations to XML content. Implement a simple Web service that reads and writes SOAP. Understand and appreciate the role of Java Servlets in the overall Java 2 Enterprise Edition architecture, and as the best Java solution to HTTP application development. Use request and response objects provided to a servlet to read CGI parameters and to produce an HTML response. Develop interactive Web applications using HTML forms and servlets. Manage complex conversations with HTTP clients using session attributes. Understand the role of JDBC in Java persistence code, and use JDBC for persistence in servlet applications. Preserve portability and ease of administration for a servlet application by parameterizing servlet code, using initialization parameters, properties files, and JNDI. Use JavaBeans classes to share complex business data between components. Implement filters to adapt existing servlets with new features, and to maximize the decomposition of logic between vertical business functions and horizontal facilities. JSP Training Prerequisites Java programming experience is required. Knowledge of HTML and background in Web applications, and/or Java programming experience, are helpful but not necessary. Outline Web Basics HTML Review

o HTML tags o HTML document structure HTTP o Requests (GET/POST) o Responses o URLs o Resource mappings and request parameters Web Applications o Structure o WAR file o Context root o Deployment Servlet Basics and API o Static vs. dynamic content o Servlets Role in a web app Servlet interface GenericServlet class HttpServlet class o Mapping a URL to a servlet class o Web container Requests and Responses o HttpServletRequest Reading HTTP request headers HTML forms Reading HTTP request parameters o HttpServletResponse Setting HTTP response headers o Monitoring requests and responses Advanced Servlets Servlet Lifecycle o Instantiation o Initialization init(servletconfig) method init() method Lazy initialization o Service service() method Relationship of service() to doget()/dopost() o Destruction destroy() method Servlet Configuration o ServletConfig interface o Reading initialization parameters Deployment Descriptors o web.xml

<servlet> element <servlet-mapping> element <welcome-file-list> element o vendor-web.xml Servlet Threading o Servlets are singletons o Servlets are multithreaded o Synchronization techniques Session Tracking HttpSession o Need for sessions o HttpSession class o Accessing the session o Session invalidation o Session timeout Cookies o Cookie class o Cookie expiration o Sending cookies to the client o Retrieving cookies from the client o JSESSIONID URL Rewriting and need for URL rewriting o URL rewriting and HttpSession Scopes o Request scope - ServletRequest class o Session scope - HttpSession class o Application scope - ServletContext class o API for using the scopes JSP Basics and Motivation o Problems with servlets o Motivation for JSPs o JSP runtime behavior Scripting Elements o Syntax rules o Comments o Scriptlets o JSP implicit objects o Expressions o Directives @page directive Imports Error pages @include directive o Declarations Model-View-Controller (MVC)

o Interactions o Model, View, Controller Advantages of MVC o Model 1 and Model 2 Model 1 Disadvantages Model 2 Controller = servlet View = JSP Model = JavaBeans, EJBs, Web Services, Spring, database entities, etc. o Redirects and Forwards Servlet redirects JSP redirects Redirect side effects Servlet forwards RequestDispatcher interface RequestDispatcher.forward() RequestDispatcher.include() Forward and include side effects Redirect vs. forward - usage guidelines JSP Tags o Standard tags, JSTL tags, custom tags o Tag syntax o Motivation for tags Accessing JavaBeans o JavaBeans review o sp:usebean Purpose id attribute scope attribute class attribute type attribute Relationship to accessing the scopes directly o jsp:getproperty Purpose name attribute property attribute Relationship to using expressions or scriptlets instead o jsp:setproperty Purpose name attribute property attribute Setting properties from request parameters Relationship to using scriptlets instead o Forwards and includes jsp:include Contrast with @include directive Relationship to RequestDispatcher.include() jsp:forward

JSP Standard Tag Library (JSTL) Relationship to RequestDispatcher.forward() o JSTL defined o Tag groups and namespaces o Using JSTL J2EE 1.4 vs. Java EE 5 @taglib directive JSP Expression Language (EL) o EL moved from JSTL to JSP 2.0 o Motivation o EL expressions and usage o EL operators o EL implicit objects o Automatic type conversion and casting o Resolving access to the scopes Core Tags o c:out o c:set o c:remove o c:foreach Using with maps o c:if o c:choose c:when c:otherwise o c:url and c:param o c:redirect Formatting Tags o fmt:formatnumber o fmt:formatdate XML and SQL Tags Discouraged when using an MVC architecture o XML tags Uses o SQL tags Uses Filters o Preprocessing and postprocessing o Uses o Filter chains Chain of Command design pattern Filter API o Filter interface Similarities and differences to servlets init(filterconfig) method FilterConfig object

destroy() method dofilter() method o FilterChain object Controlling flow through the filter chain Configuring Filters o <filter> element o <filter-mapping> element o Configuring a filter chain Custom Tags o Tag libraries o Capabilities and uses o Motivation o Using custom tags @taglib directive o Implementing Custom Tags Implementation choices Tag files Runtime behavior Tag handlers - Simple and Classic Runtime behavior Tag library descriptor (TLD) SimpleTag interface and SimpleTagSupport base class dotag() method Tag attributes, Tag body content o Tag Library Descriptors Defining the URI Defining tags in the library Location of TLD in deployment