Java Server Pages: Creating Dynamic Web Content with JSP, Slides of Java Programming

Java server pages (jsps) are a technology used for creating dynamic web content on the server. They allow for the separation of application logic and web page design, platform independence, and component reuse. Jsps support both embedded javascript and tags, and go through a translation, compile, and execution phase when accessed by a client. An overview of jsp architecture and the life cycle of a jsp page.

Typology: Slides

2011/2012

Uploaded on 07/13/2012

ahmad.ali
ahmad.ali 🇮🇳

3.7

(3)

78 documents

1 / 33

Toggle sidebar

This page cannot be seen from the preview

Don't miss anything!

bg1
1
docsity.com
pf3
pf4
pf5
pf8
pf9
pfa
pfd
pfe
pff
pf12
pf13
pf14
pf15
pf16
pf17
pf18
pf19
pf1a
pf1b
pf1c
pf1d
pf1e
pf1f
pf20
pf21

Partial preview of the text

Download Java Server Pages: Creating Dynamic Web Content with JSP and more Slides Java Programming in PDF only on Docsity!

Java Server Pages

^ A^ text

based^ document capable

of^ returning

both

static and

dynamic content

to^ a^ client

browser.

^ Static^ content^

and^ dynamic

content

can^ be

intermixed  Static^ content– HTML,

XML,^ Text ^ Dynamic

content– Java^ code– Displaying^

properties

of^ JavaBeans

  • Invoking

business

logic^ defined

in^ Custom

tags

^ Separation

of^ dynamic and

static content

Allows^ for

the^ separation

of^ application

logic^ and

Web^ page

design.

-^ Reducing

the^ complexity of

Web^ site

development

and^ making

the^ site

easier^ to

maintain.

^ Scripting

and^ tags

-^ JSPs

support

both^ embedded JavaScript

and

tags. • JavaScript

is^ typically

used^ to

add^ page

‐ level

functionality to

the^ JSP.

-^ Tags provide

an^ easy

way^ to^ embed

and

modify^

JavaBean properties.

JSP

Architecture

Life

‐ Cycle

of^ a

JSP

Page

^ Translation

phase

^ Compile

phase ^ Execution

phase

^ JSP^ files

get^ translated

into^ servlet source

code,

which^ is

then^ compiled. ^ Done^ by

the^ container

automatically

^ The^ first

time^ JSP

page^ is^ accessed

after^ it^ is

deployed

(or^ modified

and^ redeployed) ^ For^ JSP

page^ “pageName”,

the^ source

code^ resides

  • <AppServer_HOME>/work/StandardEngine/localhost/context_root/pageName$jsp.java– <AppServer_HOME>/work/StandardEngine/localhost/date/index$jsp.java

^ Declare

methods

for^ performing

the^ following

tasks

using^ JSP

declaration

mechanism

  • Read^ persistent

configuration

data

  • Initialize

resources

  • Perform

any^ other

one‐time

activities

by

overriding

jspInit()

method^

of^ JspPage interface

^ Declare

methods

for^ performing

the^ following

tasks

using^ JSP

declaration

mechanism

  • Read^ persistent

configuration

data

  • Release

resources

  • Perform

any^ other

one‐time

cleanup^

activities

by

overriding

jspDestroy()

method^

of^ JspPage

interface

-^ Java

Server Pages are

translated

into^ a^ servlet by

the^ application

server.

-^ This

process

is^ responsible

for^ translating both

the^ dynamic

and^ static

elements

declared

within

the^ JSP^ file

into^ Java

servlet code.

-^ JSPs

are^ server

‐side^ technology,

the^ processing

of^ both^ the

static^ and

dynamic

elements

of^ the

page^ occurs

in^ the^ server.