29
J2EE Web Fundamentals Lesson 7 JSP Instructor: Dr. Segun Adekile

J2EE Web Fundamentals Lesson 7 JSP

  • Upload
    herve

  • View
    35

  • Download
    0

Embed Size (px)

DESCRIPTION

J2EE Web Fundamentals Lesson 7 JSP. Instructor: Dr. Segun Adekile. Outline. Objectives Course Text Book Basham, Bryan; Sierra, Kathy; Bates, Bert (2012-10-30). Head First Servlets and JSP (Kindle Location 1349). O'Reilly Media. Kindle Edition. Using JSP: Being a JSP. Objectives. Agenda. - PowerPoint PPT Presentation

Citation preview

Page 1: J2EE Web Fundamentals Lesson 7 JSP

J2EE Web FundamentalsLesson 7

JSP

Instructor: Dr. Segun Adekile

Page 2: J2EE Web Fundamentals Lesson 7 JSP

Outline

• Objectives• Course Text Book– Basham, Bryan; Sierra, Kathy; Bates, Bert (2012-

10-30). Head First Servlets and JSP (Kindle Location 1349). O'Reilly Media. Kindle Edition.

• Using JSP:– Being a JSP

Page 3: J2EE Web Fundamentals Lesson 7 JSP

Objectives

Page 4: J2EE Web Fundamentals Lesson 7 JSP

Agenda• Introduction

– Why JSPs?– What is a JSP?

• Page Directive• JSP Element: Expressions• JSP Element: Declarations• Implicit Objects• Comments• Standard Actions• Expression Language• JSTL• Custom Tag Development

Page 5: J2EE Web Fundamentals Lesson 7 JSP

Why JSPs?

Page 6: J2EE Web Fundamentals Lesson 7 JSP

What is a JSP?

• A JSP is a servlet

Page 7: J2EE Web Fundamentals Lesson 7 JSP

What is a JSP?

• In the end, a JSP is just a servlet• Your JSP eventually becomes a full-fledged servlet running in your web

app. • It’s a lot like any other servlet, except that the servlet class is written for

you — by the Container. • The Container takes what you’ve written in your JSP, translates it into a

servlet class source (. java) file, then compiles that into a Java servlet class. • After that, it’s just servlets all the way down, and the servlet runs in

exactly the same way it would if you’d written and compiled the code yourself.

• In other words, the Container loads the servlet class, instantiates and initializes it, makes a separate thread for each request, and calls the servlet’s service() method.

Page 8: J2EE Web Fundamentals Lesson 7 JSP

A Simple JSP

Page 9: J2EE Web Fundamentals Lesson 7 JSP

Page Directive

Page 10: J2EE Web Fundamentals Lesson 7 JSP

Expressions

Page 11: J2EE Web Fundamentals Lesson 7 JSP

Declarations

Page 12: J2EE Web Fundamentals Lesson 7 JSP

Declarations

Page 13: J2EE Web Fundamentals Lesson 7 JSP

Declarations

Page 14: J2EE Web Fundamentals Lesson 7 JSP

Declarations

Page 15: J2EE Web Fundamentals Lesson 7 JSP

Generated Servlet

Page 16: J2EE Web Fundamentals Lesson 7 JSP

Generated Servlet

Page 17: J2EE Web Fundamentals Lesson 7 JSP

Implicit Objects

Page 18: J2EE Web Fundamentals Lesson 7 JSP

Comments

Page 19: J2EE Web Fundamentals Lesson 7 JSP

API for JSP Servlet

Page 20: J2EE Web Fundamentals Lesson 7 JSP

Lifecycle of a JSP

Page 21: J2EE Web Fundamentals Lesson 7 JSP

Lifecycle of a JSP

Page 22: J2EE Web Fundamentals Lesson 7 JSP

Initializing JSP

Page 23: J2EE Web Fundamentals Lesson 7 JSP

Attributes in a JSP

Page 24: J2EE Web Fundamentals Lesson 7 JSP

Three Directives

Page 25: J2EE Web Fundamentals Lesson 7 JSP

Page Directive attributes

Page 26: J2EE Web Fundamentals Lesson 7 JSP

Page Directive attributes

Page 27: J2EE Web Fundamentals Lesson 7 JSP

Scriptlets considered harmful?

Page 28: J2EE Web Fundamentals Lesson 7 JSP

Expression Language

Page 29: J2EE Web Fundamentals Lesson 7 JSP

Recap