Java Server Pages (JSP)
Java Server Pages (JSP)
I NTROCDUCTION
TO JSP
Like Servlets, JSP is also a specification. JSP technology enables Web developers and designers to rapidly develop and easily maintain, information-rich, dynamic Web pages that leverage existing business systems. As part of the Java technology family, JSP technology enables rapid development of Webbased applications that are platform independent.
T HE N EED
With servlets, it is easy to
FOR
JSP
T HE JSP F RAMEWORK
W HAT
IS JSP ?
A DVANTAGE OF JSP :
Jsp is simple , capable of creating complex web application . Jsp leverages the poer of Java. JSP simplifies web development (JSP also includes numerous implicit object that the web development process . These implicit objects allow you to retrieve and process data submitted in form, track users, and send output to a web browser. Jsp is not limited to a particular platform. Jsp is an integral part of J2EE.
J SP
LIFE CYCLE
EXAMPLE
S CRIPTING E LEMENTS
S CRIPTING E LEMENTS
S CRIPTING E LEMENTS
I MPLICIT
OBJECTS
I MPLICIT
OBJECTS
MVC
I MPLICIT
OBJECTS
JSP D IRECTIVES
JSP directives are used to convey special processing information about the page to JSP container. It affects the overall structure of the servlet that results from the JSP page. It enables programmer to: Specify page settings To Include content from other resources To specify custom-tag libraries Format
<%@ directive {attribute=val}* %> In JSP, there are three types of directives: page, include & taglib. The formats of using these are:
page: <%@ page {attribute=val}* %> include: <%@ include {attribute=val}* %> taglib: <%@ taglib {attribute=val}* %>
JSP
PAGE
D IRECTIVE
Give high level information about servlet that will result from JSP page. It can be used anywhere in the document. It can control Which classes are imported
JSP
PAGE
D IRECTIVE
JSP
INCLUDE
D IRECTIVE