You are on page 1of 292

Internet Banking System

Internet Banking System


1
INDEX
1. Introduction
2. System Analysis
a. Existing System
b. proposed System
3. Feasibility Report
a. Technical Feasibility
b. perational Feasibility
c. Economical Feasibility
!. System Re"uirement Speci#ication $ocument
a. %er%ie&
b. 'odules $escription
c. (rocess Flo&
d. S$)* 'ethodology
e. So#t&are Re"uirements
#. +ard&are Re"uirements
2
,. System $esign
a. $F$
b. E-R diagram
c. .')
d. $ata $ictionary
/. Technology $escription
0. *oding
1. Testing 2 $ebugging Techni"ues
3. utput Screens
14. Reports
11. Future Enhancements
12. *onclusion
13. 5ibliography
3
INTRODUCTION

4
)oo6ing #or an online comprehensi%e solution to manage internet
ban6ing. This &ill be accessible to all customers &ho ha%e a %alid user id and
pass&ord. This system pro%ides the #ollo&ing #acilities777
5alance en"uiry
Funds trans#er to another account in the same ban6
Re"uest #or che"ue boo68change o# address8stop payment o#
che"ues.
9ie&ing monthly and annual statements
In India: a number o# ban6s ha%e either gone #or Internet 5an6ing or are on
the %erge o# going #or it. Internet 5an6ing System I am tal6ing about is
di##erent #rom &hat &as possible up to no& - o## line in#ormation or #e&
limited ser%ices. I am tal6ing about the type that enables the customer to
transact business on line in real time.
The Internet 5an6ing System pro%ides the #acilities li6e 5alance
En"uiry : Funds trans#er to another account in the same ban6: Re"uest #or
che"ue boo6 8change o# address8stop payment o# che"ues and 9ie&ing
monthly and annual statements. The Internet 5an6ing System has de%eloped
a ne& security in#rastructure #or conducting commerce on the Internet. The
initiati%e: called 5an6I$: aims to become a national I$ in#rastructure
supporting ser%ices such as authentication and digital signatures #or the entire
authentication population.
'any researchers expect rapid gro&th in customers using online ban6ing
products and ser%ices. The Internet 5an6ing System allo&s customer contact
through increased geographical reach and lo&er cost deli%ery channels.
*ustomers can reach a gi%en institution #rom literally any&here in the &orld.
'anagement must understand the ris6s associated &ith The Internet 5an6ing
5
System be#ore they ma6e a decision to de%elop a particular class o# business.
'anagement should ha%e the s6ills to e##ecti%ely e%aluate internet ban6ing
technologies and products. .se the Internet 5an6ing System: the choice is
yours. 'a6e it &isely.
6
System Analysis


7
Purpose of the System:
This system pro%ides an online solution to the customer by pro%iding
#acilities such as balance en"uiry: #unds trans#er to another account in the
same ban6 etc.
!isting System:
Existing system is a manual system it &ill not pro%ide the online
system
Existing system does not pro%ide the separate login #or the user
;customer<.
Existing system does not pro%ide the online transaction #acility.
This system does not gi%e the update account in#ormation #or the
customer
Propose" System:
The de%elopment o# this ne& system contains the #ollo&ing acti%ities:
&hich try to de%elop on-line application by 6eeping the entire process in
the %ie& o# data base integration approach.
*ustomer must ha%e a %alid user I$ and pass&ord to login to the
system
I# a &rong pass&ord is gi%en thrice in the session: that account
&ill be loc6ed and the customer &ill not be able to use it. =hen an
in%alid pass&ord is entered a &arning is gi%en to the user than
the count going to get loc6ed.
A#ter the %alid user logs in he is sho&n the list o# accounts he has
&ith the ban6.
n selecting the desired account he is ta6en to a page &hich
sho&s the present balance in that particular account number. .ser
can %ie& his monthly as &ell as annual statements. +e can also
ta6e print out o# the same.
.ser can trans#er #unds #rom his account to any other account
&ith this ban6.
8
I# the transaction is success#ul a noti#ication should appear to the
customer: in case it is unsuccess#ul: a proper message should be
gi%en to the customer as to &hy it #ailed.
9
#easi$ility Stu"y
10
TC%NICA& #ASIBI&IT':
E%aluating the technical #easibility is the tric6iest part o# a #easibility study.
This is because: at this point in time: not too many detailed design o# the
system: ma6ing it di##icult to access issues li6e per#ormance: costs on ;on
account o# the 6ind o# technology to be deployed< etc. A number o# issues
ha%e to be considered &hile doing a technical
analysis.
i( Un"erstan" the "ifferent te)hnologies in*ol*e" in the propose"
system:
5e#ore commencing the pro>ect: &e ha%e to be %ery clear about &hat
are the technologies that are to be re"uired #or the de%elopment o# the
ne& system.
ii( #in" out +hether the organi,ation )urrently possesses the
re-uire" te)hnologies:
o Is the re"uired technology a%ailable &ith the organi?ation@
o I# so is the capacity su##icient@
For instance AB=ill the current printer be able to handle the
ne& reports and #orms re"uired #or the ne& system@C
Operational #easi$ility:
(roposed pro>ect is bene#icial only i# it can be turned into in#ormation systems
that &ill meet the organi?ations operating re"uirements. Simply stated: this
test o# #easibility as6s i# the system &ill &or6 &hen it is de%eloped and
installed. Are there ma>or barriers to Implementation@ +ere are "uestions that
&ill help test the operational #easibility o# a pro>ectDIs there su##icient support
#or the pro>ect #rom management #rom users@ I# the current system is &ell
li6ed and used to the extent that persons &ill not be able to see reasons #or
change: there may be resistance.
11
Are the current business methods acceptable to the user@ I# they are not:
.sers may &elcome a change that &ill bring about a more operational and
use#ul systems.
+a%e the user been in%ol%ed in the planning and de%elopment o# the pro>ect@
Early in%ol%ement reduces the chances o# resistance to the system and in
general and increases the li6elihood o# success#ul pro>ect.
Since the proposed system &as to help reduce the hardships encountered. In
the existing manual system: the ne& system &as considered to be operational
#easible.
)onomi) #easi$ility:
Economic #easibility attempts 2 &eigh the costs o# de%eloping and
implementing a ne& system: against the bene#its that &ould accrue #rom
ha%ing the ne& system in place. This #easibility study gi%es the top
management the economic >usti#ication #or the ne& system.
A simple economic analysis &hich gi%es the actual comparison o# costs and
bene#its are much more meaning#ul in this case. In addition: this pro%es to be
a use#ul point o# re#erence to compare actual costs as the pro>ect progresses.
There could be %arious types o# intangible bene#its on account o# automation.
These could include increased customer satis#action: impro%ement in product
"uality better decision ma6ing timeliness o# in#ormation: expediting acti%ities:
impro%ed accuracy o# operations: better documentation and record 6eeping:
#aster retrie%al o# in#ormation: better employee morale.
12
System Re-uirement Spe)ifi)ation
O*er*ie+:
13
)oo6ing #or an online comprehensi%e solution to manage internet
ban6ing. This &ill be accessible to all customers &ho ha%e a %alid user id and
pass&ord. This system pro%ides the #ollo&ing #acilities777
5alance en"uiry
Funds trans#er to another account in the same ban6
Re"uest #or che"ue boo68change o# address8stop payment o#
che"ues.
9ie&ing monthly and annual statements
14
.o"ules Des)ription
15
No of .o"ules:
The system a#ter care#ul analysis has been identi#ied to be presented
&ith the #ollo&ing modulesD
The 'odules in%ol%ed are
1. Administrator.
2. *ustomer.
3. Transaction.
4. Security and authentication.
,. Reports
Des)ription for .o"ules:
A"ministrator:
Administrator can add the customers ;users< and pro%ides some
username and pass&ord #or the customer. Administrator can accept the
che"ue boo6 re"uests: %ie& all the transactions and pro%ide loans in#ormation
and branch details.
Customer:
.ser can ma6e a #unds trans#er to another account in the same
ban6. .ser is pro%ided &ith a transaction pass&ord &hich is di##erent #rom the
login pass&ord. .ser applies the che"ue boo6 re"uestsE %ie& all the loan
in#ormation: sub branch details.
Transa)tion:
16
.ser can trans#er #unds #rom his account to any other account &ith
this ban6. I# the transaction is success#ul a noti#ication should appear to the
customer: in case it is unsuccess#ul: and a proper message should be gi%en to
the customer &hy it #ailed.
Se)urity an" authenti)ation:/
1. .ser registration
2. )ogin as a user or administrator
3. *hange pass&ord
!. Forgot pass&ord
Reports:/
In this module the di##erent actors can generate the di##erent types o# reports
according to their access.
17

Pro)ess #lo+
18
The 'odel 2 architecture #or designing FS( pages is in reality: 'odel
9ie& *ontroller ;'9*< applied to &eb applications. +ence the t&o terms can
be used interchangeably in the &eb &orld. '9* originated in SmallTal6 and
has since made its &ay into Fa%a community. 'odel 2 architecure and its
deri%ati%es are the cornerstones #or all serious and industrial strength &eb
applications designed in the real &orld. +ence it is essential #or you
understand this paradigm thoroughly.
The main di##erence bet&een 'odel 1 and 'odel 2 is that in 'odel 2: a
controller handles the user re"uest instead o# another FS(. The controller is
implemented as a Ser%let. The #ollo&ing steps are executed &hen the user
submits the re"uest.
1. The *ontroller Ser%let handles the userGs re"uest. ;This means the
hyperlin6 in the FS( should point to the controller ser%let<.
2. The *ontroller Ser%let then instantiates appropriate Fa%a5eans
based on the re"uest parameters ;and optionally also based on session
attributes<.
3. The *ontroller Ser%let then by itsel# or through a controller helper
communicates &ith the middle tier or directly to the database to #etch
the re"uired data.
!. The *ontroller sets the resultant Fa%a5eans ;either same or a ne&
one< in one o# the #ollo&ing contexts A re"uest: session or application.
,. The controller then dispatches the re"uest to the next %ie& based on
the re"uest .R).
/. The 9ie& uses the resultant Fa%a5eans #rom Step ! to display data.
Hote that there is no presentation logic in the FS(. The sole #unction o#
the FS( in 'odel 2 architecture is to display the data #rom the
Fa%a5eans set in the re"uest: session or application scopes.
0.
1.
9.
19
'odel-2 Architecture.
20
SD&C .T%ODO&O0IS
21
This document play a %ital role in the de%elopment o# li#e cycle ;S$)*<
as it describes the complete re"uirement o# the system. It means #or use
by de%elopers and &ill be the basic during testing phase. Any changes
made to the re"uirements in the #uture &ill ha%e to go through #ormal
change appro%al process.
S(IRA) '$E) &as de#ined by 5arry 5oehm in his 1311 article: BA spiral
'odel o# So#t&are $e%elopment and Enhancement. This model &as not
the #irst model to discuss iterati%e de%elopment: but it &as the #irst model
to explain &hy the iteration models.
As originally en%isioned: the iterations &ere typically / months to 2
years long. Each phase starts &ith a design goal and ends &ith a client
re%ie&ing the progress thus #ar. Analysis and engineering e##orts are
applied at each phase o# the pro>ect: &ith an eye to&ard the end goal o#
the pro>ect.
The steps #or Spiral 'odel can be generali?ed as #ollo&sD
The ne& system re"uirements are de#ined in as much details as
possible. This usually in%ol%es inter%ie&ing a number o# users
representing all the external or internal users and other aspects o#
the existing system.
A preliminary design is created #or the ne& system.
A #irst prototype o# the ne& system is constructed #rom the
preliminary design. This is usually a scaled-do&n system: and
represents an approximation o# the characteristics o# the #inal
product.
A second prototype is e%ol%ed by a #our#old procedureD
1. E%aluating the #irst prototype in terms o# its strengths:
&ea6ness: and ris6s.
2. $e#ining the re"uirements o# the second prototype.
3. (lanning an designing the second prototype.
22
!. *onstructing and testing the second prototype.
At the customer option: the entire pro>ect can be aborted i# the ris6
is deemed too great. Ris6 #actors might in%ol%ed de%elopment cost
o%erruns: operating-cost miscalculation: or any other #actor that
could: in the customerGs >udgment: result in a less-than-satis#actory
#inal product.
The existing prototype is e%aluated in the same manner as &as the
pre%ious prototype: and i# necessary: another prototype is de%eloped
#rom it according to the #our#old procedure outlined abo%e.
The preceding steps are iterated until the customer is satis#ied that
the re#ined prototype represents the #inal product desired.
The #inal system is constructed: based on the re#ined prototype.
The #inal system is thoroughly e%aluated and tested. Routine
maintenance is carried on a continuing basis to pre%ent large scale
#ailures and to minimi?e do&n time.
The follo+ing "iagram sho+s ho+ a spiral mo"el a)ts like:
23
#ig 123/Spiral .o"el
AD4ANTA0S:
Estimates;i.e. budget: schedule etc .< become more relistic as &or6
progresses: because important issues disco%ed earlier.
24
It is more able to cope &ith the changes that are so#t&are
de%elopment generally entails.
So#t&are engineers can get their hands in and start &oring on the
core o# a pro>ect earlier.
25
SO#T5AR R6UIR.NT AND
%ARD5AR R6UIR.NT
26
Soft+are Re-uirements :
perating System D =indo&s I(82443 or )inux
.ser Inter#ace D +T'): *SS
*lient-side Scripting D Fa%aScript
(rogramming )anguage D Fa%a
=eb Applications D F$5*: Ser%lets: FS(
I$E8=or6bench D 'y Eclipse /.4
$atabase D racle 14g
Ser%er $eployment D Tomcat ,.x
Frame =or6 D Struts 1.x
%ar"+are Re-uirements:
(rocessor D (entium I9
+ard $is6 D !4J5
RA' D ,12'5 or more
27
System Design


28
DATA #&O5 DIA0RA.S
29
DATA #&O5 DIA0RA.S:
A graphical tool used to describe and analy?e the moment o# data
through a system manual or automated including the process: stores o# data:
and delays in the system. $ata Flo& $iagrams are the central tool and the
basis #rom &hich other components are de%eloped. The trans#ormation o#
data #rom input to output: through processes: may be described logically and
independently o# the physical components associated &ith the system. The
$F$ is also 6no& as a data #lo& graph or a bubble chart.
$F$s are the model o# the proposed system. They clearly should sho&
the re"uirements on &hich the ne& system should be built. )ater during
design acti%ity this is ta6en as the basis #or dra&ing the systemGs structure
charts. The 5asic Hotation used to create a $F$Gs are as #ollo&sD
Dataflo+: $ata mo%e in a speci#ic direction #rom an origin to a destination.
Pro)ess: (eople: procedures: or de%ices that use or produce ;Trans#orm<
$ata. The physical component is not identi#ied.
30

72 Sour)e: External sources or destination o# data: &hich may be (eople:
programs: organi?ations or other entities.
Data Store: +ere data are stored or re#erenced by a process in the System.
Conte!t &e*el DATA #&O5 DIA0RA.:
31

$ata Input Stages
$ata Input Stages
UI S)reens
Reports
$ata Input Stages
CONT8T &4& DATA #&O5 DIA0RA.
System Pro)ess
$ata utput Stages
$ata utput Stages
$ata utput Stages
InternetBanking
A"ministrator
ployee
Cutomer
$
a
t
a

5
a
s
e
Bran)hes
Ser*i)es
&ogin
Transa)tions
Che-ues
Balan)e

32
$ata Input Stages
$ata Input Stages
UI S)reens
Reports
$ata Input Stages
CONT8T &4& DATA #&O5 DIA0RA.
System Pro)ess
$ata utput Stages
$ata utput Stages
$ata utput Stages
InternetBanking
A"ministrator
ployee
Cutomer
$
a
t
a

5
a
s
e
Bran)hes
Ser*i)es
&ogin
Transa)tions
Che-ues
Balan)e

AUT%NTICATION D#D:
33
GUI Interface Username,Password Authentication Server
Authentication Server Authentication GUI Interface
NO
)e%el 2 $ata Flo& $iagram #or .sers Authentication
AD.IN:
34
$ata Input Stages
UI S)reens
Reports
CONT8T &4& DATA #&O5 DIA0RA.
System Pro)ess
$ata utput Stages
$ata utput Stages
$ata utput Stages
InternetBanking
A"ministrator
$
a
t
a

5
a
s
e
mployee
Bran)hes
Ser*i)es
A))ounttypes
#un"Transfer
Che-BookRe-
)e%el1 $ata Flo& $iagram #or AdminD
35
Admin
UI displaying
set
Of Operations
Login
General
Information
ViewAccount
Types
View
ChequeIssue
s
View
CustomerTra
nsactions
View
Serices
View!ranche
s
Add
"mployee
View
#equests
&4&/9:
A"ministrator:
GUI Interface Employee Data ase InputSta!e OutputSta!e
Data ase Employee GUI Interface InputSta!e OutputSta!e
GUI Interface ranches Data ase InputSta!e OutputSta!e
Data ase ranches GUI Interface InputSta!e OutputSta!e
36
GUI Interface Services Data ase InputSta!e OutputSta!e
Data ase Services GUI Interface InputSta!e OutputSta!e
GUI Interface
Account"type
s
Data ase InputSta!e OutputSta!e
Data ase Account"ypes GUI Interface InputSta!e OutputSta!e
37
GUI Interface #und"ransfer Data ase InputSta!e OutputSta!e
Data ase #und"ransfer GUI Interface InputSta!e OutputSta!e
GUI Interface $he%oo&re% Data ase InputSta!e OutputSta!e
Data ase
$he%oo&'e
%
GUI Interface InputSta!e OutputSta!e
38
&4&/7:
AD.INISTRATOR:
Option(
AddEmployee
0UI Interfa)e A""mployee#ile
A""mployee#ile DataStore GUI Interface
Input Output
In:ut Output
0UI Interfa)e
Option)
*iewEmployee
4ie+mployee#ile
4ie+mployee#ile DataStore 0IU Interfa)e
Input Output
Input Output
39
Option+
Addranches
0UI Interfa)e A""Bran)hes#ile
A""Bran)hes#ile DataStore GUI Interface
Input Output
Input Output
0UI Interfa)e
Option,
*iewranches
4ie+Bran)hes#ile
4ie+Bran)hes#ile DataStore 0IU Interfa)e
Input Output
Input Output
40
Option-
AddServices
0UI Interfa)e A""Ser*i)esfile
A""Ser*i)es#ile DataStore GUI Interface
Input Output
Input Output
0UI Interfa)e
Option.
*iewServices
4ie+Ser*i)es#ile
4ie+Ser*i)es#ile DataStore 0IU Interfa)e
Input Output
Input Output
41
Option/
*iew#und"ransfer
0UI Interfa)e
4ie+#un"Transfer#
ile
4ie+#un"Transfer#
ile
DataStore GUI Interface
Input Output
Input Output
0UI Interfa)e
Option0
*iew1o!inDetails
4ie+&ogin"etails#ile
4ie+&oginDetails#il
e
DataStore 0IU Interfa)e
Input Output
Input Output
Option 2
*iew$he%oo&re%
0UIInterfa)e 4ie+Ch-$ookRe-#ile
4ie+Ch-BookRe-#ile DataStore GUIInterface
Input Output
Input Output
0UIInterfa)e
Option (3
*iewStopPayments
4ie+StopPayment#ile
4ie+StopPayment#ile DataStore 0IUInterfa)e
Input Output
Input Output
42
&4&/;:
A"ministrator:

Open form45
6666666666666666666
,7(7(73
Enter #irstName
6666666666666666666666
,7(7(7(
Enter 8idName
6666666666666666666666666
,7(7(7)
1astName
66666666666666666666666666
,7(7(7+
ar 'e! Date
66666666666666666666666666
,7(7(7,
Select 9ualification
666666666666666666666666666
,7(7(7-
Enter Photo!raph
66666666666666666666666666
,7(7(7.
Address
6666666666666666666666666
,7(7(7/
PhoneNum:er
66666666666666666666666666
,7(7(70
Emailid
66666666666666666666666
,7(7(72
Enter Pin no
,7(7(7(3
)e%el ! $ata Flo& $iagram #or Add Employee $etails
Open form45
6666666666666666666
,7(7)73
Enter
Acc"ypeName
6666666666666666666666
,7(7)7(
EnterA::reviation
,7(7)7)
Enter Description
666666666666666666666666666
,7(7)7+
Enter8inOpenal
,7(7)7,
Ente8a;Openal
,7(7)7-
Enterintrest
666666666666666666666666666
,7(7)7.
Enter8inal
666666666666666666666666666
,7(7)7/

)e%el ! $ata Flo& $iagram #or Add Acc Types $etails
43
mployee:
UI S)reens
Reports
$ata Input Stages
CONT8T &4& DATA #&O5 DIA0RA.
System Pro)ess
$ata utput Stages
$ata utput Stages
$ata utput Stages
InternetBanking
ployee
$
a
t
a

5
a
s
e
Customer
Banks
#un"Transfe
r
Che-ues
StopPayment
CusTransa)tio
n
44
&e*el1 Data #lo+ Diagram for mployee:
"mployee
UI displaying
set
Of Operations
Login
General
Information
ViewAccount
Types
View
ChequeIssue
s
View
CustomerTra
nsactions
View
Serices
#egistration
View!ranche
s
&4&/9:
.P&O':
GUI Interface $ustomer Data ase Input Output
Data ase $ustomer GUI Interface Input Output
45
GUI Interface an&s Data ase Input Output
Data ase an&s GUI Interface Input Output
GUI Interface #und"ransfer Data ase Input Output
Data ase #und"ransfer GUI Interface Input Output
GUI Interface $he%ues Data ase Input Output
Data ase $he%ues GUI Interface Input Output
46
GUI Interface StopPay Data ase Input Output
Data ase StopPay GUI Interface Input Output
GUI Interface
$us"ransactio
n
Data ase Input Output
Data ase
$us"ransactio
n
GUI Interface Input Output
&4&/7:
mployee:
Option(
Add$ustomers
0UI Interfa)e A""Customer#ile
A""Customer#ile DataStore 0IU Interfa)e
Input Output
Input Output
47
Option)
*iew$ustomer#ile
0UI Interfa)e 4ie+Customer#ile
4ie+Customer#ile DataStore 0IU Interfa)e
Input Output
Input Output
Option+
*iewranches
0UI Interfa)e 4ie+Bran)hes#ile
4ie+Bran)hes#ile DataStore 0IU Interfa)e
Input Output
Input Output
Option,
*iewAccount"ypes
0UI Interfa)e 4ie+A))ountTypes#ile
4ie+A))ounttypes#ile DataStore 0IU Interfa)e
Input
Input Output
Output
48
Option-
*iewStopPayments
0UI Interfa)e 4ie+StopPayments#ile
4ie+StopPayments#ile DataStore 0IU Interfa)e
Input Output
Input Output
Option.
AddalanceEn%uiry
0UI Interfa)e A""Balan)en-uiry#ile
A""Balan)en-uiry#ile DataStore 0IU Interfa)e
Input Output
Input Output
Option/
*iewalanceEn%uiry#ile
0UI Interfa)e 4ie+Balan)en-uiry#ile
4ie+Balan)een-uiry#ile DataStore 0IU Interfa)e
Input Output
Input Output
49
Option0
Add$he%ueoo&'e%
0UI Interfa)e A""Che-BookRe-#ile
A""Che-BookRe-#ile DataStore GUI Interface
Input Output
Input Output
0UI Interfa)e
Option2
*iew$he%oo&'e%
4ie+Che-Bookre-#ile
4ie+Che-BookRe-#ile DataStore 0IU Interfa)e
Input Output
Input Output
0UI Interfa)e A"".oneyTransa)tion#ile
A"".oneyTransa)tion#ile DataStore 0IU Interfa)e
Input Output
Input Output
Option(3
Add8oneytransaction
50
Option((
*iew8oney"ransaction
0UI Interfa)e 4ie+.oneyTransa)tion#ile
4ie+.oneyTransa)tion#ile DataStore 0IU Interfa)e
Input
Input Output
Output
&4&/;:
mployee:
Open form 45
6666666666666666666
,7(7,73
Enter
$ase"ypeName
6666666666666666666666
,7(7,7(
Enter $ase"ype
A::reviation
6666666666666666666666666
,7(7,7)
Enter $ase
"ypeDescription
666666666666666666666666666
,7(7,7+
Enter Sdate
6666666666666666666
,7(7,7,
Enter $he%ueDate
6666666666666666666
,7(7,7-
Enter $he%ueNo
6666666666666666666
,7(7,7.
Select $ustomerId
6666666666666666666
,7(7,7/
)e%el ! $ata Flo& $iagram #or Stop (ayment 'aster $etails
51
&4&/3:
52
Customer:
UI S)reens
Reports
$ata Input Stages
CONT8T &4& DATA #&O5 DIA0RA.
System Pro)ess
$ata utput Stages
$ata utput Stages
$ata utput Stages
InternetBanking
Customer
$
a
t
a

5
a
s
e
Banks
&oginDetails
Balan)e
Che-ues
StopPayment
CusTransa)tio
n
53
UI S)reens
Reports
$ata Input Stages
CONT8T &4& DATA #&O5 DIA0RA.
System Pro)ess
$ata utput Stages
$ata utput Stages
$ata utput Stages
InternetBanking
Customer
$
a
t
a

5
a
s
e
Banks
&oginDetails
Balan)e
Che-ues
StopPayment
CusTransa)tio
n
&e*el1Data #lo+ Diagram #or Customer:
54
Customer
UI displaying
set
Of Operations
Login
General
Information
ViewAccount
Types
Add $oney
Transactions
View
$oneyTransa
ctions
View
Serices
#egistration
View!ranche
s
&4&/9:
Customer:
GUI Interface an&s Data ase Input Output
Data ase an&s GUI Interface Input Output
55
GUI Interface 1o!inDetails Data ase Input Output
Data ase 1o!inDetails GUI Interface Input Outptu
GUI Interface $he%ues Data ase Input Output
Data ase $he%ues GUI Interface Input Output
GUI Interface alance Data ase Input Output
Data ase alance GUI Interface Input Output
56
GUI Interface
StopPayemen
t
Data ase Input Output
Data ase StopPayment GUI Interface Input Output
GUI Interface
$us"ransactio
n
Data ase Input Output
Data ase
$us"ransactio
n
GUI Interface Input Output
&4&/7:
Customer:
Option(
*iewan&ranches
0UI Interfa)e 4ie+Bran)hes#ile
4ie+Bran)hes#ile DataStore 0UI Interfa)e
Input Output
Input Output
57
Option)
*iewAccount"ype
0UI Interfa)e 4ie+A))ountType#ile
4ie+A))ountType#ile DataStore 0UI Interfa)e
Input
Input Output
Outptu
Option+
*iew1o!inDetails
0UI Interfa)e 4ie+&oginDetailsform
4ie+&ogin"etails#orm DataStore 0UI Interfa)e
Input Output
Input Output
Option,
Add8Oney"ransaction
0UI Interfa)e A"".oneyTransa)tion#ile
A"".oneyTransa)tion#ile DataStore 0UI Interfa)e
Input Output
Input Output
58
Option-
*iew8oney"ransaction
0UI Interfa)e 4ie+.oneyTransa)tion#ile
4ie+.oneyTransa)tion#ile DataStore 0UI Interfa)e
Input Output
Input Output
Option.
Add$he%ueoo&'e%uest
8aster
0UI Interfa)e A""Che-ueBookRe-"et#ile
A""Che-Bookre-Det#ile DataStore 0UI Interfa)e
Input Output
Input Output
Option/
*iew$he%ueoo&'e%ue
st8aster
0UI Interfa)e 4ie+Che-ueBookRe-"et#ile
4ie+Che-Bookre-Det#ile DataStore 0UI Interfa)e
Input Output
Input Output
59
Option0
*iew$he%IssueDet
0UI Interfa)e 4ie+Che-IssueDet#ile
4ie+Che-IssueDet#ile DataStore 0UI Interfa)e
Input Output
Input Output
&4&/;:
Customer:
Open form45
6666666666666666666
,7(7)73
Enter
1aw"ypeName
6666666666666666666666
,7(7)7(
Enter A::reviation
6666666666666666666666666
,7(7)7)
Enter Description
666666666666666666666666666
,7(7)7+
Open form45
6666666666666666666
,7(7+73
Enter AccountNo
66666666666666666666666666666
,7(7+7(
Enter 'e%uest"ime
6666666666666666666666666
,7(7+7)
Enter 'e%uestDate
666666666666666666666666666
,7(7+7+
Section
$utomerId
666666666666666666666666666
,7(7+7,
Enter
$he%u:oo&Posted
it
6666666666666666666666
,7(7+7-
Enter Previous
oo&Status
6666666666666666666666666
,7(7)7+7.
)e%el ! $ata Flo& $iagram #or Add *he"ue 5oo6 Re"uest $etails
60
/R Diagram
61
62
63
U.& Diagrams
<Unifie" .o"eling &anguage<
64
The .ni#ied 'odeling )anguage allo&s the so#t&are engineer to express an
analysis model using the modeling notation that is go%erned by a set o#
syntactic semantic and pragmatic rules.
A .') system is represented using #i%e di##erent %ie&s that describe the
system #rom distinctly di##erent perspecti%e. Each %ie& is de#ined by a set o#
diagram: &hich is as #ollo&s.
User .o"el 4ie+:
i. This %ie& represents the system #rom the users perspecti%e.
ii. The analysis representation describes a usage scenario #rom the
end-users perspecti%e.
Stru)tural mo"el *ie+:
i. In this model the data and #unctionality are arri%ed #rom inside
the system.
ii. This model %ie& models the static structures.
Beha*ioral .o"el 4ie+:
It represents the dynamic o# beha%ioral as parts o# the system:
depicting the interactions o# collection bet&een %arious structural
elements described in the user model and structural model %ie&.
Implementation .o"el 4ie+:
In this the structural and beha%ioral as parts o# the system are
represented as they are to be built.
n*ironmental .o"el 4ie+:
65
In this the structural and beha%ioral aspects o# the en%ironment in
&hich the system is to be implemented are represented.
U.& is spe)ifi)ally )onstru)te" through t+o "ifferent "omains
they are:
i. .') Analysis modeling: this #ocuses on the user model and
structural model %ie&s o# the system.
ii. .') design modeling: &hich #ocuses on the beha%ioral modeling:
implementation modeling and en%ironmental model %ie&s.
Use )ase Diagrams represent the #unctionality o# the system #rom a
userGs point o# %ie&. .se cases are used during re"uirements elicitation
and analysis to represent the #unctionality o# the system. .se cases
#ocus on the beha%ior o# the system #rom external point o# %ie&.
A)tors are external entities that interact &ith the system. Examples o#
actors include users li6e administrator: ban6 customer 7etc.: or another
system li6e central database.
66
67

68
Use Case Diagrams
69
System use )ase Diagram:

System
Administ rat or
Employ ee
Cust omer
Int er net Bank ing
70
A"ministrator Use )ase Diagram:
Administ rat or
Employees
Branches
Services
Account Types
Fund Transfer
Cust omer Login
Cheq Book eq
St op !ayment
Add Employee
"ie# Employee
Add Branches
"ie# Branches
Add Services
"ie# Services
Add Account Types
"ie# Account Types
"ie# Fund t ransfers
"ie# Login $et ails
"ie# equest s
"ie# St op !ay ment s
71
mployee Use )ase Diagram:
Employee
cust omers
Banks
Fund Transfer
Cheques
St op !ayment
Cus t ransact ion
Add Cust omers
"ie# Cust omers
vie# Branches
vie# Account t ypes
"ie# Services
"ie# Fund Transfer
vie# Cheq eq
"ie# chq cancel
add Cheq issue
"ie# Chq Issue
Add St op !ayment
"ie# St op !ay
"ie# CusTransac
72
Customer Use Case Diagram:
Cust omer
Banks
Login
Balance
Cheques
Transact ion
St op !ayment
"ie# Branches
"ie# Services
"ie# Account Types
"ie# Login $et ails
Add Bal Enquiry
"ie# Bal Enq
Add Cheq %ook req
vie# Cheq eq
"ie# St op !ayment s
Add &oney Transac
"ie# &oney Transac
73
Se-uen)e Diagrams
74
A"ministrator Se-uen)e Diagram:
Administrator Authentication "mployees !ranches Serices Account Types %und Transfer CustomerLogin Cheq!oo&#eq Stop'ayment
Success(
%ailed()
if fail
Add "mployee()
View
Add
View
Add
View
Add Account
View Account
View %und
View Login
View Cheque !oo&
View Stop 'ayment
75
mployee Se-uen)e Diagram:
%und Transfer "mployee Authentication Customers !an&s Cheques Stop 'ayment Cus
Transaction
Login()
%ail()
if fails if success
Add
View
View
View
View
View %und
View Cheque
View Cheque
Add Cheque Issue()
View ChequeIssue()
Add Stop
View Stop
View CustomerTransac
76
Customer Se-uen)e Diagram:
Cheques Customer Authntication !an&s Login !alance Stop'ayment Transaction
Login()
%ailed()
Chec&(
if %ailes
if Success
View
View
View Account
View Login
Add !alance
View !alance
Add Cheque!oo&
ViewCheque!oo&
ViewStop
Add$oney
View$oney
77
Colla$oration Diagram
78
A"min Colla$oration Diagram:
Administ
rator
Authenti
cation
"mploye
es
!ranche
s
Serices
Account
Types
%und
Transfer
Customer
Login
Cheq!oo&
#eq
Stop
'ayment
*+ Success()
,+
-+ %ailed()
.+ Add "mployee()
/+ View "mployee()
0+ Add !ranches()
1+ View 2ranches()
3+ Add Serices()
4+ View Serices()
*5+ Add Account Types()
**+ View Account Types()
*,+ View %undTransfer()
*-+
*.+ View Login 6etails()
*/+ View Cheque !oo& #equests()
*0+ View Stop 'ayment 6etails()
79
mployee Colla$oration Diagram:
Cus
Transaction
"mploye
e
Authenti
cation
Custome
rs
!an&s
%und
Transfer
Cheques
Stop
'ayment
*+ Login()
,+
-+ %ail()
.+ Add Customers()
/+ View Customers()
0+ View !ranches()
1+ View Accounts()
3+ View Serices()
4+ View %und Transfers()
*5+ View Cheque #equest()
**+ View Cheque Cancel()
*,+ Add Cheque Issue()
*-+ View ChequeIssue()
*.+ Add Stop 'ayment()
*/+ View Stop'ayment()
*0+ View CustomerTransacTion()
80
Customer Colla$oration Diagram:
Login
Custome
r
Authntic
ation
!an&s
!alance
Cheques
Stop
'ayment
Transact
ion
*+ Login()
,+ Chec&()
-+ %ailed()
.+ View !ranches()
/+ View Serices()
0+ View AccountTypes()
1+ View Login6etails()
3+ Add !alance "nquiry()
4+ View !alance "nquiry()
*5+ Add Cheque!oo& #equest()
**+ ViewCheque!oo&#equest()
*,+ ViewStop'ayments()
*-+ Add$oneyTransaction()
*.+ View$oneyTransaction()
81
A)ti*ity Diagrams

82
A"ministrator A)ti*ity Diagram:
83
mployee A)ti*ity Diagram:
Employee
Authentication
Check Authentication
Enter 'ser(ame)!ass#ord
if Success
if fail
Check
*ome
Customer Banks FundTransfer Cheques
Stop!ay Logout
AddCustomer "ie#Customer
"ie#Branches "ie#AccTypes AddCheqissue
AddStop!ay "ie#FundTransfer
CusTransac
"ie#CusTransac
"ie#ChqIssue "ie#Service "ie#Chqeq
"ie#Stop!ay
84
Customer A)ti*ity Diagram:
Customer
Authentication
Check Authentication
Enter 'ser(ame)!ass#ord
if Success
if fail
Check
*ome
Banks Login Balance Cheques
Stop!ay Logout
"ie#Branches "ie#Services "ie#Login$et
AddCheqeq
"ie#Stop!ay
AddBalEnquiry
Transaction
"ie#BalEnq
"ie#Chqeq
"ie#AccountTypes "ie#BalEnquiry
85
Component Diagram
86

87
Deployment Diagram
88
89
Data Di)tionary
90
User.aster:
DATA DICTIONARY:
LoginDetail:
login!"o#ile:
$A%&ACCO'NT(
91
ACCO'NTTY!)%A(T)R:
A**o+ntT,-e%ate":
$AN&ACCO'NT(TY!)(
92
$an.$"an*/%ate":
$"an*/A**o+ntT,-e:
$an.e"0i*e%ate":
$"an*/(e"0i*e%ate"
#iel"Name DataType Constraint
.SERI$ H.'5ER (RI'ARK LEK
.SERHA'E 9AR*+AR2;24<
(ASS=R$ 9AR*+AR2;24<
FIRSTHA'E 9A*+AR2;24<
'I$$)EHA'E 9AR*+AR2;24<
)ASTHA'E 9AR*+AR2;24<
$5 $ATE
$R $ATE
93
$E $ATE
A$$RESS 9AR*+AR2;24<
(+HE 9AR*+AR2;24<
E'AI) 9AR*+AR2;,4<
(+T 5)5
5an65ranch'asterD
#iel"Name DataType Constraint
5RAH*+I$ H.'5ER (RI'ARK LEK
5RAH*+A$$RESS 9AR*+AR2;24<
5RAH*+(+HEHHE 9AR*+AR2;24<
5RAH*+(+HEHT= 9AR*+R2;24<
5RAH*+(+HEHT+REE 9AR*+AR2;24<
5RAH*+E'AI)I$ 9AR*+AR2;24<
5RAH*+IH*+JI$ H.'5ER FREIJH LEK
BAN=SR4ICS.ASTR
#iel"Name DataType Constraint
SER9I*EI$ H.'5ER (RI'ARK LEK
SER9I*EHA'E 9AR*+AR2;24<
SER9I*EA*TI9ESTATE 9AR*+AR2;24<
SER9I*E$ES* 9AR*+AR2;24<
BRANC%SR4IC.ASTR
#iel"Name DataType Constraint
5RAH*+I$ H.'5ER FREIJH LEK
SER9I*EI$ H.'5ER FREIJH LEK
.P&O'S.ASTR
#iel"Name DataType Constraint
E'()KEEI$ H.'5ER (RI'ARK LEK
HA'E 9AR*+AR2;24<
$5 $ATE
$F $ATE
A$$RESS 9AR*+AR2;24<
94
(+HE 9AR*+AR2;24<
'AI) 9AR*+R2;24<
(+T 5)5
5RAH*+I$ H.'5ER FREIJH LEK
ACCOUNTT'P.ASTR
#iel"Name DataType Constraint
A**.HTTK(EI$ H.'5ER (RI'ARK LEK
TK(EHA'E 9AR*+AR2;24<
A55RE9ATIH 9AR*+R2;24<
'IH(EH5A)AH*E H.'5ER;14:2<
'AI(EH5A)AH*E H.'5ER;14:2<
IHTRESTA(()I*A5)E5IT H.'5ER
$ES*RI(TIH 9AR*+AR2;24<
'IH5A)AH*ET5E'AIHTAIHE$ H.'5ER;14:2<
*+E*L5LFA*I)ITK5IT H.'5ER
5AHLTK(E5IT H.'5ER
5A)A*H*ETK(E5IT H.'5ER
S6& 6URIS #OR DATA BAS :
TAB& : ACCOUNTTYPEMASTER
CREATE TABLE ACCOUNTTYPEMASTER
(
ACCOUNTTYPEID NUMBER,
TYPENAME VARCHAR2(20 BYTE),
ABBREVATION VARCHAR2(20 BYTE),
MINOPENBALANCE NUMBER(10,2),
MAXOPENBALANCE NUMBER(10,2),
INTRESTAPPLICABLEBIT VARCHAR2(20 BYTE),
DESCRIPTION VARCHAR2(20 BYTE),
MINBALANCETOBEMAINTAINED NUMBER(10,2),
CHECKBOOKFACILITYBIT VARCHAR2(20 BYTE),
BANKTYPEBIT VARCHAR2(20 BYTE),
BALACNCETYPEBIT VARCHAR2(20 BYTE)
)
95
TABLESPACE USERS
PCTUSED 0
PCTFREE 10
INITRANS 1
MAXTRANS 255
STORAGE (
INITIAL 64K
MINEXTENTS 1
MAXEXTENTS 2147483645
PCTINCREASE 0
BUFFER_POOL DEFAULT
)
LOGGING
NOCOMPRESS
NOCACHE
NOPARALLEL
MONITORING;
ALTER TABLE ACCOUNTTYPEMASTER ADD (
PRIMARY KEY
(ACCOUNTTYPEID)
USING INDEX
TABLESPACE USERS
PCTFREE 10
INITRANS 2
MAXTRANS 255
STORAGE (
INITIAL 64K
MINEXTENTS 1
MAXEXTENTS 2147483645
PCTINCREASE 0
));
BALANCEENQUIRYMASTER :
CREATE TABLE BALANCEENQUIRYMASTER
(
ENQUIRYID NUMBER,
ENQUIRYDATE DATE,
LOGINID VARCHAR2(20 BYTE),
FROMDATE DATE,
TODATE DATE,
ACCOUNTNO NUMBER,
AMOUNT NUMBER
)
TABLESPACE USERS
PCTUSED 0
PCTFREE 10
INITRANS 1
MAXTRANS 255
STORAGE (
INITIAL 64K
MINEXTENTS 1
MAXEXTENTS 2147483645
PCTINCREASE 0
96
BUFFER_POOL DEFAULT
)
LOGGING
NOCOMPRESS
NOCACHE
NOPARALLEL
MONITORING;
ALTER TABLE BALANCEENQUIRYMASTER ADD (
PRIMARY KEY
(ENQUIRYID)
USING INDEX
TABLESPACE USERS
PCTFREE 10
INITRANS 2
MAXTRANS 255
STORAGE (
INITIAL 64K
MINEXTENTS 1
MAXEXTENTS 2147483645
PCTINCREASE 0
));
ALTER TABLE BALANCEENQUIRYMASTER ADD (
CONSTRAINT BALANCEENQUIRYMASTER_R01
FOREIGN KEY (ACCOUNTNO)
REFERENCES BANKACCOUNTS (ACCOUNTNO));
CREATE TABLE BANKACCOUNTS
(
LOGINID VARCHAR2(20 BYTE),
ACCOUNTNO NUMBER,
ACCOUNTINITIALBALANCE NUMBER,
ACCOUNTACTIVEBALANCE NUMBER,
ACCOUNTOPENINGDATE DATE,
BRANCHADDRESS VARCHAR2(20 BYTE)
)
TABLESPACE USERS
PCTUSED 0
PCTFREE 10
INITRANS 1
MAXTRANS 255
STORAGE (
INITIAL 64K
MINEXTENTS 1
MAXEXTENTS 2147483645
PCTINCREASE 0
BUFFER_POOL DEFAULT
)
LOGGING
NOCOMPRESS
97
NOCACHE
NOPARALLEL
MONITORING;
CREATE UNIQUE INDEX BANKACCOUNTS_PK ON BANKACCOUNTS
(ACCOUNTNO)
LOGGING
TABLESPACE USERS
PCTFREE 10
INITRANS 2
MAXTRANS 255
STORAGE (
INITIAL 64K
MINEXTENTS 1
MAXEXTENTS 2147483645
PCTINCREASE 0
BUFFER_POOL DEFAULT
)
NOPARALLEL;
BANKACCOUNTS:
ALTER TABLE BANKACCOUNTS ADD (
CONSTRAINT BANKACCOUNTS_PK
PRIMARY KEY
(ACCOUNTNO)
USING INDEX
TABLESPACE USERS
PCTFREE 10
INITRANS 2
MAXTRANS 255
STORAGE (
INITIAL 64K
MINEXTENTS 1
MAXEXTENTS 2147483645
PCTINCREASE 0
));
ALTER TABLE BANKACCOUNTS ADD (
CONSTRAINT BANKACCOUNTS_R01
FOREIGN KEY (LOGINID)
REFERENCES LOGINDETAILS (LOGINNAME));
BANKACCOUNTTYPES:
CREATE TABLE BANKACCOUNTTYPES
(
BRANCHID NUMBER,
ACCOUNTYPEID NUMBER
)
TABLESPACE USERS
PCTUSED 0
PCTFREE 10
INITRANS 1
98
MAXTRANS 255
STORAGE (
INITIAL 64K
MINEXTENTS 1
MAXEXTENTS 2147483645
PCTINCREASE 0
BUFFER_POOL DEFAULT
)
LOGGING
NOCOMPRESS
NOCACHE
NOPARALLEL
MONITORING;
ALTER TABLE BANKACCOUNTTYPES ADD (
CONSTRAINT BANKACCOUNTTYPES_R01
FOREIGN KEY (ACCOUNTYPEID)
REFERENCES ACCOUNTTYPEMASTER (ACCOUNTTYPEID));
BANKBRANCHMASTER:
CREATE TABLE BANKBRANCHMASTER
(
BRANCHID NUMBER,
BRANCHADDRESS VARCHAR2(20 BYTE),
BRANCHPHONENO1 VARCHAR2(20 BYTE),
BRANCHPHONENO2 VARCHAR2(20 BYTE),
BRANCHPHONENO3 VARCHAR2(20 BYTE),
EMAIL VARCHAR2(20 BYTE)
)
TABLESPACE USERS
PCTUSED 0
PCTFREE 10
INITRANS 1
MAXTRANS 255
STORAGE (
INITIAL 64K
MINEXTENTS 1
MAXEXTENTS 2147483645
PCTINCREASE 0
BUFFER_POOL DEFAULT
)
LOGGING
NOCOMPRESS
NOCACHE
NOPARALLEL
MONITORING;
ALTER TABLE BANKBRANCHMASTER ADD (
PRIMARY KEY
(BRANCHID)
USING INDEX
TABLESPACE USERS
PCTFREE 10
99
INITRANS 2
MAXTRANS 255
STORAGE (
INITIAL 64K
MINEXTENTS 1
MAXEXTENTS 2147483645
PCTINCREASE 0
));
BANKSERVICESMASTER:
CREATE TABLE BANKSERVICESMASTER
(
SERVICEID NUMBER,
SERVICENAME VARCHAR2(20 BYTE),
SERVICEACTIVESTATE VARCHAR2(20 BYTE),
SERVICEDESC VARCHAR2(20 BYTE)
)
TABLESPACE USERS
PCTUSED 0
PCTFREE 10
INITRANS 1
MAXTRANS 255
STORAGE (
INITIAL 64K
MINEXTENTS 1
MAXEXTENTS 2147483645
PCTINCREASE 0
BUFFER_POOL DEFAULT
)
LOGGING
NOCOMPRESS
NOCACHE
NOPARALLEL
MONITORING;
ALTER TABLE BANKSERVICESMASTER ADD (
PRIMARY KEY
(SERVICEID)
USING INDEX
TABLESPACE USERS
PCTFREE 10
INITRANS 2
MAXTRANS 255
STORAGE (
INITIAL 64K
MINEXTENTS 1
MAXEXTENTS 2147483645
PCTINCREASE 0
));
100
BRANCHEMPLOYEE:
CREATE TABLE BRANCHEMPLOYEE
(
LOGINNAME VARCHAR2(20 BYTE),
BRANCHADDRESS VARCHAR2(20 BYTE)
)
TABLESPACE USERS
PCTUSED 0
PCTFREE 10
INITRANS 1
MAXTRANS 255
STORAGE (
INITIAL 64K
MINEXTENTS 1
MAXEXTENTS 2147483645
PCTINCREASE 0
BUFFER_POOL DEFAULT
)
LOGGING
NOCOMPRESS
NOCACHE
NOPARALLEL
MONITORING;
ALTER TABLE BRANCHEMPLOYEE ADD (
CONSTRAINT BRANCHEMPLOYEE_R01
FOREIGN KEY (LOGINNAME)
REFERENCES LOGINDETAILS (LOGINNAME));
101
BRANCHSERVICEMASTER:
CREATE TABLE BRANCHSERVICEMASTER
(
BRANCHID NUMBER,
SERVICEID NUMBER
)
TABLESPACE USERS
PCTUSED 0
PCTFREE 10
INITRANS 1
MAXTRANS 255
STORAGE (
INITIAL 64K
MINEXTENTS 1
MAXEXTENTS 2147483645
PCTINCREASE 0
BUFFER_POOL DEFAULT
)
LOGGING
NOCOMPRESS
NOCACHE
NOPARALLEL
MONITORING;
ALTER TABLE BRANCHSERVICEMASTER ADD (
CONSTRAINT BRANCHSERVICEMASTER_R01
FOREIGN KEY (SERVICEID)
REFERENCES BANKSERVICESMASTER (SERVICEID));
CHEQUEBOOKREQUESTMASTER :
CREATE TABLE CHEQUEBOOKREQUESTMASTER
(
REQUESTID NUMBER,
REQUESTDATE DATE,
LOGINID VARCHAR2(20 BYTE),
ACCOUNTNO NUMBER,
CHEQUEBOOKTEST VARCHAR2(20 BYTE),
PREVIOUSCHEQUEBOOKSTATUS VARCHAR2(20 BYTE),
STATUS VARCHAR2(20 BYTE)
)
TABLESPACE USERS
PCTUSED 0
PCTFREE 10
INITRANS 1
102
MAXTRANS 255
STORAGE (
INITIAL 64K
MINEXTENTS 1
MAXEXTENTS 2147483645
PCTINCREASE 0
BUFFER_POOL DEFAULT
)
LOGGING
NOCOMPRESS
NOCACHE
NOPARALLEL
MONITORING;
ALTER TABLE CHEQUEBOOKREQUESTMASTER ADD (
CONSTRAINT CHEQUEBOOKREQUESTMASTER_R01
FOREIGN KEY (ACCOUNTNO)
REFERENCES BANKACCOUNTS (ACCOUNTNO));
CHEQUEISUEMASTER:
CREATE TABLE CHEQUEISUEMASTER
(
CHEQUEISSUEID NUMBER,
REQUESTID NUMBER,
ISUEDATE DATE,
FROMNUMBER NUMBER,
TONUMBER NUMBER,
ACCOUNTNO NUMBER,
EMPLOYEENAME VARCHAR2(20 BYTE),
NOOFCHEQUES NUMBER
)
TABLESPACE USERS
PCTUSED 0
PCTFREE 10
INITRANS 1
MAXTRANS 255
STORAGE (
INITIAL 64K
MINEXTENTS 1
MAXEXTENTS 2147483645
PCTINCREASE 0
BUFFER_POOL DEFAULT
)
LOGGING
NOCOMPRESS
NOCACHE
NOPARALLEL
MONITORING;
ALTER TABLE CHEQUEISUEMASTER ADD (
PRIMARY KEY
103
(CHEQUEISSUEID)
USING INDEX
TABLESPACE USERS
PCTFREE 10
INITRANS 2
MAXTRANS 255
STORAGE (
INITIAL 64K
MINEXTENTS 1
MAXEXTENTS 2147483645
PCTINCREASE 0
));
ALTER TABLE CHEQUEISUEMASTER ADD (
CONSTRAINT CHEQUEISUEMASTER_R01
FOREIGN KEY (ACCOUNTNO)
REFERENCES BANKACCOUNTS (ACCOUNTNO));
CUSTOMERTRANSACTIONMASTER:
CREATE TABLE CUSTOMERTRANSACTIONMASTER
(
TRANSACTIONID NUMBER,
EMPLOYEENAME VARCHAR2(20 BYTE),
TRANSACTIONDATE DATE,
TRANSACTIONTYPE VARCHAR2(20 BYTE),
AMOUNT NUMBER,
ACCOUNTNO NUMBER,
BRANCHNAME VARCHAR2(20 BYTE)
)
TABLESPACE USERS
PCTUSED 0
PCTFREE 10
INITRANS 1
MAXTRANS 255
STORAGE (
INITIAL 64K
MINEXTENTS 1
MAXEXTENTS 2147483645
PCTINCREASE 0
BUFFER_POOL DEFAULT
)
LOGGING
NOCOMPRESS
NOCACHE
NOPARALLEL
MONITORING;
CREATE UNIQUE INDEX CUSTOMERTRANSACTIONMASTER_PK ON CUSTOMERTRANSACTIONMASTER
(TRANSACTIONID)
LOGGING
TABLESPACE USERS
PCTFREE 10
INITRANS 2
MAXTRANS 255
104
STORAGE (
INITIAL 64K
MINEXTENTS 1
MAXEXTENTS 2147483645
PCTINCREASE 0
BUFFER_POOL DEFAULT
)
NOPARALLEL;
ALTER TABLE CUSTOMERTRANSACTIONMASTER ADD (
CONSTRAINT CUSTOMERTRANSACTIONMASTER_PK
PRIMARY KEY
(TRANSACTIONID)
USING INDEX
TABLESPACE USERS
PCTFREE 10
INITRANS 2
MAXTRANS 255
STORAGE (
INITIAL 64K
MINEXTENTS 1
MAXEXTENTS 2147483645
PCTINCREASE 0
));
ALTER TABLE CUSTOMERTRANSACTIONMASTER ADD (
CONSTRAINT CUSTOMERTRANSACTIONMASTER_R01
FOREIGN KEY (ACCOUNTNO)
REFERENCES BANKACCOUNTS (ACCOUNTNO));
FUNDSTRANSFER:
CREATE TABLE FUNDSTRANSFER
(
FUNDSTRANSFERID NUMBER,
FUNDSTRANSFERDATE DATE,
FROMACCOUNTNO VARCHAR2(20 BYTE),
TOACCOUNTNO VARCHAR2(20 BYTE),
AMOUNT NUMBER,
LOGINID VARCHAR2(20 BYTE)
)
TABLESPACE USERS
PCTUSED 0
PCTFREE 10
INITRANS 1
MAXTRANS 255
STORAGE (
INITIAL 64K
MINEXTENTS 1
MAXEXTENTS 2147483645
PCTINCREASE 0
BUFFER_POOL DEFAULT
105
)
LOGGING
NOCOMPRESS
NOCACHE
NOPARALLEL
MONITORING;
ALTER TABLE FUNDSTRANSFER ADD (
PRIMARY KEY
(FUNDSTRANSFERID)
USING INDEX
TABLESPACE USERS
PCTFREE 10
INITRANS 2
MAXTRANS 255
STORAGE (
INITIAL 64K
MINEXTENTS 1
MAXEXTENTS 2147483645
PCTINCREASE 0
));
ALTER TABLE FUNDSTRANSFER ADD (
CONSTRAINT FUNDSTRANSFER_R01
FOREIGN KEY (LOGINID)
REFERENCES LOGINDETAILS (LOGINNAME));
LOGINAUDIT:
CREATE TABLE LOGINAUDIT
(
LOGINID VARCHAR2(20 BYTE),
LOGINDATE DATE,
LOGINDESC VARCHAR2(200 BYTE)
)
TABLESPACE USERS
PCTUSED 0
PCTFREE 10
INITRANS 1
MAXTRANS 255
STORAGE (
INITIAL 64K
MINEXTENTS 1
MAXEXTENTS 2147483645
PCTINCREASE 0
BUFFER_POOL DEFAULT
)
LOGGING
NOCOMPRESS
NOCACHE
NOPARALLEL
MONITORING;
ALTER TABLE LOGINAUDIT ADD (
106
FOREIGN KEY (LOGINID)
REFERENCES LOGINDETAILS (LOGINNAME)
ON DELETE CASCADE);
LOGINDETAILS:
CREATE TABLE LOGINDETAILS
(
LOGINNAME VARCHAR2(20 BYTE),
PASSWORD VARCHAR2(20 BYTE),
FIRSTNAME VARCHAR2(20 BYTE),
LASTNAME VARCHAR2(20 BYTE),
LOGINTYPE VARCHAR2(20 BYTE),
LOGINSTATUS VARCHAR2(20 BYTE),
REGDATE DATE,
SQUESTIONID NUMBER,
SANSWER VARCHAR2(20 BYTE),
FIRSTLOGIN NUMBER,
PASSMODIFIEDDATE DATE
)
TABLESPACE USERS
PCTUSED 0
PCTFREE 10
INITRANS 1
MAXTRANS 255
STORAGE (
INITIAL 64K
MINEXTENTS 1
MAXEXTENTS 2147483645
PCTINCREASE 0
BUFFER_POOL DEFAULT
)
LOGGING
NOCOMPRESS
NOCACHE
NOPARALLEL
MONITORING;
ALTER TABLE LOGINDETAILS ADD (
PRIMARY KEY
(LOGINNAME)
USING INDEX
TABLESPACE USERS
PCTFREE 10
INITRANS 2
MAXTRANS 255
STORAGE (
INITIAL 64K
MINEXTENTS 1
MAXEXTENTS 2147483645
PCTINCREASE 0
107
));
ALTER TABLE LOGINDETAILS ADD (
UNIQUE (PASSWORD)
USING INDEX
TABLESPACE USERS
PCTFREE 10
INITRANS 2
MAXTRANS 255
STORAGE (
INITIAL 64K
MINEXTENTS 1
MAXEXTENTS 2147483645
PCTINCREASE 0
));
LOGINPROFILE:
CREATE TABLE LOGINPROFILE
(
LOGINID VARCHAR2(20 BYTE),
BIRTHDATE DATE,
HNO VARCHAR2(20 BYTE),
STREET VARCHAR2(20 BYTE),
CITY VARCHAR2(20 BYTE),
STATE VARCHAR2(20 BYTE),
COUNTRY VARCHAR2(20 BYTE),
PINCODE VARCHAR2(20 BYTE),
CONTACTNO VARCHAR2(20 BYTE),
EMAIL VARCHAR2(200 BYTE),
LOCALE VARCHAR2(20 BYTE),
PROFILEMODIFIEDDATE DATE
)
TABLESPACE USERS
PCTUSED 0
PCTFREE 10
INITRANS 1
MAXTRANS 255
STORAGE (
INITIAL 64K
MINEXTENTS 1
MAXEXTENTS 2147483645
PCTINCREASE 0
BUFFER_POOL DEFAULT
)
LOGGING
NOCOMPRESS
NOCACHE
NOPARALLEL
MONITORING;
ALTER TABLE LOGINPROFILE ADD (
FOREIGN KEY (LOGINID)
REFERENCES LOGINDETAILS (LOGINNAME)
108
ON DELETE CASCADE);
QUESTIONBASE :
CREATE TABLE QUESTIONBASE
(
QUESTIONID NUMBER,
QUESTIONDETAIL VARCHAR2(20 BYTE)
)
TABLESPACE USERS
PCTUSED 0
PCTFREE 10
INITRANS 1
MAXTRANS 255
STORAGE (
INITIAL 64K
MINEXTENTS 1
MAXEXTENTS 2147483645
PCTINCREASE 0
BUFFER_POOL DEFAULT
)
LOGGING
NOCOMPRESS
NOCACHE
NOPARALLEL
MONITORING;
ALTER TABLE QUESTIONBASE ADD (
PRIMARY KEY
(QUESTIONID)
USING INDEX
TABLESPACE USERS
PCTFREE 10
INITRANS 2
MAXTRANS 255
STORAGE (
INITIAL 64K
MINEXTENTS 1
MAXEXTENTS 2147483645
PCTINCREASE 0
));
STOPPAYMENTMASTER :
CREATE TABLE STOPPAYMENTMASTER
(
STOPPAYMENTTYPEID NUMBER,
STOPPAYDATE DATE,
LOGINID VARCHAR2(20 BYTE),
ACCOUNTNO VARCHAR2(20 BYTE),
109
CHEQUENO NUMBER,
AMOUNT NUMBER(10,2),
CHEQUEDATE DATE,
REASONFORSTOPPING VARCHAR2(20 BYTE),
STATUS VARCHAR2(20 BYTE)
)
TABLESPACE USERS
PCTUSED 0
PCTFREE 10
INITRANS 1
MAXTRANS 255
STORAGE (
INITIAL 64K
MINEXTENTS 1
MAXEXTENTS 2147483645
PCTINCREASE 0
BUFFER_POOL DEFAULT
)
LOGGING
NOCOMPRESS
NOCACHE
NOPARALLEL
MONITORING;
ALTER TABLE STOPPAYMENTMASTER ADD (
PRIMARY KEY
(STOPPAYMENTTYPEID)
USING INDEX
TABLESPACE USERS
PCTFREE 10
INITRANS 2
MAXTRANS 255
STORAGE (
INITIAL 64K
MINEXTENTS 1
MAXEXTENTS 2147483645
PCTINCREASE 0
));
110
S-l -uries use" in our pro>e)ts:
)he)kPass+or"//////////sele)t ? from login"etails +here pass+or"@A
an" loginname@A
)he)k#irst&ogin//////////sele)t firstlogin from login"etails +here
loginname@A
loginChe)k/////////////////sele)t logintype from login"etails +here
pass+or"@A an" loginname@A an" loginstatus@Bunlo)kB
//////////////////up"ate login"etails set firstlogin@B3B +here
loginname@A
//////////////////sele)t loginnameClogintype from login"etails
+here loginname@A
///////////////////up"ate login"etails set firstlogin@DE )ount
E D +here loginname@A
loginau"it////////////////////insert into loginau"it *alues<ACACA(
)hangePass+or"//////////UPDAT login"etails ST
pass+or"@ACpassmo"ifie""ate@A 5%R loginname@A an"
pass+or"@A
)hange6uestion///////////sele)t <ma!<-uestioni"((E1 from
-uestion$ase
UPDAT login"etails ST s-uestioni"@ACsans+er@A
5%R loginname@A an" pass+or"@A
UPDAT login"etails ST
s-uestioni"@ACsans+er@A 5%R loginname@A an" pass+or"@A
re)o*erPass+or"By!ist6uestion/////S&CT pass+or" #RO.
login"etails 5%R loginname@A an" s-uestioni"@A an" sans+er@A
registration////////////////////sele)t -uestioni" from -uestion$ase
+here -uestion"etail@BDEo+nse)ret-uestEDBD
111
sele)t <ma!<-uestioni"((E1 from
-uestion$ase
INSRT INTO -uestion$ase 4A&US<ACA(
insert into &O0INDTAI&S *alues<ACACACACACACACACACACA(
insert into &O0INPRO#I&
*alues<ACACACACACACACACACACACA(
getProfile//////////////////////sele)t
l"2firstnameCl"2lastnameClp2$irth"ateClp2)ityClp2stateClp2)ountry from
login"etails l"Cloginprofile lp +here l"2loginname@lp2logini" an"
l"2loginname@BDEloginnameEDBD
mo"ifyProfile///////////////////UPDAT loginprofile ST
$irth"ate@AChno@ACstreet@AC)ity@ACstate@AC)ountry@ACpin)o"e@AC)ont
a)tno@ACemail@ACprofilemo"ifie""ate@A 5%R logini"@AD(F
UPDAT login"etails ST
firstname@AClastname@A 5%R loginname@AF
)hangeA))ountStatus//////UPDAT login"etails ST loginstatus@A
5%R loginname@A
getProfile/////////////////////////sele)t
l"2loginnameCl"2firstnameCl"2lastnameClp2$irth"ateClp2)ityClp2stateClp2)o
untry from login"etails l"Cloginprofile lp +here
l"2loginname@lp2logini" an" l"2logintype@BmployeeB
112
Te)hnology Des)ription
%T.&
An initiali?e o# +ypertext 'ar6up )anguage: is the predominant mar6up
language #or &eb pages. It pro%ides a means to describe the structure o# text-
based in#ormation in a document M by denoting certain text as headings:
paragraphs: lists: and so on M and to supplement that text &ith interacti%e
#orms: embedded images: and other ob>ects. +T') is &ritten in the #orm o#
labels ;6no&n as tags<: surrounded by angle brac6ets. +T') can also
describe: to some degree: the appearance and semantics o# a document: and
can include embedded scripting language code &hich can a##ect the beha%ior
o# &eb bro&sers and other +T') processors.
113
+T') is also o#ten used to re#er to content o# the 'I'E type text8html or e%en
more broadly as a generic term #or +T') &hether in its I')-descended #orm
;such as I+T') 1.4 and later< or its #orm descended directly #rom SJ')
+yper Text 'ar6up )anguage
+ypertext 'ar6up )anguage ;+T')<: the languages o# the =orld =ide =eb
;===<: allo&s users to produces =eb pages that include text: graphics and
pointer to other =eb pages ;+yperlin6s<.
+T') is not a programming language but it is an application o# IS Standard
1103: SJ') ;Standard Jenerali?ed 'ar6up )anguage<: but speciali?ed to
hypertext and adapted to the =eb. The idea behind +ypertext is that instead
o# reading text in rigid linear structure: &e can easily >ump #rom one point to
another point. =e can na%igate through the in#ormation based on our interest
and pre#erence. A mar6up language is simply a series o# elements: each
delimited &ith special characters that de#ine ho& text or other items enclosed
&ithin the elements should be displayed. +yperlin6s are underlined or
emphasi?ed &or6s that load to other documents or some portions o# the same
document.
+T') can be used to display any type o# document on the host computer:
&hich can be geographically at a di##erent location. It is a %ersatile language
and can be used on any plat#orm or des6top.
+T') pro%ides tags ;special codes< to ma6e the document loo6 attracti%e.
+T') tags are not case-sensiti%e. .sing graphics: #onts: di##erent si?es: color:
etc.: can enhance the presentation o# the document. Anything that is not a tag
is part o# the document itsel#.
5asic +T') TagsD
114
NO -- --P speci#ies comments
NAP777. N8AP *reates hypertext lin6s
N5P777. N85P Formats text as bold
N5IJP777. N85IJP Formats text in large #ont.
N5$KP7N85$KP All tags and text in the +T') document
N*EHTERP...N8*EHTERP *reates text
N$$P7N8$$P $e#inition o# a term
N$)P...N8$)P *reates de#inition list
NFHTP7N8FHTP Formats text &ith a particular #ont
NFR'P...N8FR'P Encloses a #ill-out #orm
NFRA'EP...N8FRA'EP $e#ines a particular #rame in a set o#
#rames
N+QP7N8+QP *reates headings o# di##erent le%els; 1 A / <
N+EA$P...N8+EA$P In#ormation about a document
N+RP...N8+RP *reates a hori?ontal rule
N+T')P7N8+T')P *ontains all other +T') tags
N'ETAP...N8'ETAP 'eta-in#ormation about a document
NS*RI(TP7N8S*RI(TP *ontains client-side or ser%er-side script
NTA5)EP7N8TA5)EP *reates a table
NT$P7N8T$P Indicates table data in a table
NTRP7N8TRP $esignates a table ro&
115
NT+P7N8T+P *reates a heading in a table
Attri$utes:
The attributes o# an element are name-%alue pairs: separated by RSR: and
&ritten &ithin the start label o# an element: a#ter the elementTs name. The
%alue should be enclosed in single or double "uotes: although %alues
consisting o# certain characters can be le#t un"uoted in +T') ;but not
I+T')<.)ea%ing attribute %alues un"uoted is considered unsa#e.
'ost elements ta6e any o# se%eral common attributesD id: class: style and
title. 'ost also ta6e language-related attributesD )ang and $ir.
The id attribute pro%ides a document-&ide uni"ue identi#ier #or an element.
This can be used by style sheets to pro%ide presentational properties: by
bro&sers to #ocus attention on the speci#ic element or by scripts to alter the
contents or presentation o# an element. The class attribute pro%ides a &ay o#
classi#ying similar elements #or presentation purposes. For example: an +T')
document ;or a set o# documents< may use the designation classSRnotationR
to indicate that all elements &ith this class %alue are all subordinate to the
main text o# the document ;or documents<. Such notation classes o# elements
might be gathered together and presented as #ootnotes on a page: rather than
appearing in the place &here they appear in the source +T').
An author may use the style non-attribute codes presentational properties to a
particular element. It is considered better practice to use an elementGs son- id
page and select the element &ith a style sheet: though sometimes this can be
too cumbersome #or a simple ad hoc application o# styled properties. The title
is used to attach sub textual explanation to an element. In most bro&sers this
title attribute is displayed as &hat is o#ten re#erred to as a tooltip. The generic
inline span element can be used to demonstrate these %arious non-attributes.
116
The preceding displays as +T') ;pointing the cursor at the abbre%iation
should display the title text in most bro&sers<.
A"*antages:
A +T') document is small and hence easy to send o%er the net. It is
small because it does not include #ormatted in#ormation.
+T') is plat#orm independent.
+T') tags are not case-sensiti%e.
Ga*aS)ript
Fa%aScript is a script-based programming language that &as de%eloped by
Hetscape *ommunication *orporation. Fa%aScript &as originally called )i%e
Script and renamed as Fa%aScript to indicate its relationship &ith Fa%a.
Fa%aScript supports the de%elopment o# both client and ser%er components o#
=eb-based applications. n the client side: it can be used to &rite programs
that are executed by a =eb bro&ser &ithin the context o# a =eb page. n the
ser%er side: it can be used to &rite =eb ser%er programs that can process
in#ormation submitted by a =eb bro&ser and then update the bro&serGs
display accordingly
E%en though Fa%aScript supports both client and ser%er =eb programming: &e
pre#er Fa%aScript at *lient side programming since most o# the bro&sers
supports it. Fa%aScript is almost as easy to learn as +T'): and Fa%aScript
117
statements can be included in +T') documents by enclosing the statements
bet&een a pair o# scripting tags
NS*RI(TSP.. N8S*RI(TP.
NS*RI(T )AHJ.AJE S BFa%aScriptCP
Fa%aScript statements
N8S*RI(TP
%ere are a fe+ things +e )an "o +ith Ga*aS)ript:
9alidate the contents o# a #orm and ma6e calculations.
Add scrolling or changing messages to the 5ro&serGs status
line.
Animate images or rotate images that change &hen &e
mo%e the mouse o%er them.
$etect the bro&ser in use and display di##erent content #or
di##erent bro&sers.
$etect installed plug-ins and noti#y the user i# a plug-in is
re"uired.
=e can do much more &ith Fa%aScript: including creating entire application.
Ga*aS)ript 4s Ga*a:
Fa%aScript and Fa%a are entirely di##erent languages. A #e& o# the most glaring
di##erences areD
Fa%a applets are generally displayed in a box &ithin the &eb
documentE Fa%aScript can a##ect any part o# the =eb
document itsel#.
118
=hile Fa%aScript is best suited to simple applications and
adding interacti%e #eatures to =eb pagesE Fa%a can be used
#or incredibly complex applications.
There are many other di##erences but the important thing to remember
is that Fa%aScript and Fa%a are separate languages. They are both use#ul #or
di##erent thingsE in #act they can be used together to combine their
ad%antages.
Ad%antages
Fa%aScript can be used #or Se%er-side and *lient-side
scripting.
It is more #lexible than 95Script.
Fa%aScript is the de#ault scripting languages at *lient-side
since all the bro&sers supports it.
8.&
5hat Is 8.&A
8.&D A mar6up language #or organi?ing in#ormation in text #iles. I') stands
#or extensible 'ar6up )anguage.
8.& #ileD A text #ile that contains in#ormation organi?ed in a structure that
meets I') standards.
I') can also be %ie&ed as a meta-language #or de#ining more speci#ic mar6up
languages: because it only speci#ies the structural rules o# unspeci#ied tags
that are used to organi?e in#ormation. ne can easily extend I') to de#ine a
119
speci#ic mar6up language by speci#ying a set o# tags and their structural
relations. Examples o# I')-based mar6up languages include S9J: 3$'): and
+R'').
+ere is ho& to create your #irst I') #ile.
1. .se any text editor to enter the #ollo&ing lines o# text into a #ileD
N@ Iml %ersionSR1.4R@P
NpP+ello &orldO N8pP
2. Sa%e this #ile &ith nameD Rhello.xmlR.
*ongratulationsO Kou ha%e success#ully created an I') #ile.
#eatures of 8.&:
'ain #eatures o# I')D
I') #iles are text #iles: &hich can be managed by any text
editor.
I') is %ery simple: because it has less than 14 rules.
I') is extensible: because it only speci#ies the structural
rules o# tags. Ho speci#ication on tags them sel#.
Ga*a Te)hnology
Initially the language &as called as Boa6C but it &as renamed as BFa%aC in
133,. The primary moti%ation o# this language &as the need #or a plat#orm-
independent ;i.e.: architecture neutral< language that could be used to create
so#t&are to be embedded in %arious consumer electronic de%ices.
Fa%a is a programmerGs language.
Fa%a is cohesi%e and consistent.
120
Except #or those constraints imposed by the Internet en%ironment:
Fa%a gi%es the programmer: #ull control.
Finally: Fa%a is to Internet programming &here * &as to system
programming.
Importan)e of Ga*a to the Internet
Fa%a has had a pro#ound e##ect on the Internet. This is becauseE Fa%a expands
the .ni%erse o# ob>ects that can mo%e about #reely in *yberspace. In a
net&or6: t&o categories o# ob>ects are transmitted bet&een the Ser%er and
the (ersonal computer. They areD (assi%e in#ormation and $ynamic acti%e
programs. The $ynamic: Sel#-executing programs cause serious problems in
the areas o# Security and probability. 5ut: Fa%a addresses those concerns and
by doing so: has opened the door to an exciting ne& #orm o# program called
the Applet.
Ga*a )an $e use" to )reate t+o types of programs
Appl ications and Appl etsD An application is a program that runs on our
*omputer under the operating system o# that computer. It is more or less li6e
one creating using * or *UU. Fa%aGs ability to create Applets ma6es it
important. An Applet is an application designed to be transmitted o%er the
Internet and executed by a Fa%a Acompatible &eb bro&ser. An applet is
actually a tiny Fa%a program: dynamically do&nloaded across the net&or6:
>ust li6e an image. 5ut the di##erence is: it is an intelligent program: not >ust a
media #ile. It can react to the user input and dynamically change.
#eatures of Ga*a Se)urity
E%ery time you that you do&nload a BnormalC program: you are ris6ing a %iral
in#ection. (rior to Fa%a: most users did not do&nload executable programs
121
#re"uently: and those &ho did scan them #or %iruses prior to execution. 'ost
users still &orried about the possibility o# in#ecting their systems &ith a %irus.
In addition: another type o# malicious program exists that must be guarded
against. This type o# program can gather pri%ate in#ormation: such as credit
card numbers: ban6 account balances: and pass&ords. Fa%a ans&ers both
these concerns by pro%iding a B#ire&allC bet&een a net&or6 application and
your computer.
=hen you use a Fa%a-compatible =eb bro&ser: you can sa#ely do&nload Fa%a
applets &ithout #ear o# %irus in#ection or malicious intent.
Porta$ility
For programs to be dynamically do&nloaded to all the %arious types o#
plat#orms connected to the Internet: some means o# generating portable
executable code is needed .As you &ill see: the same mechanism that helps
ensure security also helps create portability. Indeed: Fa%aGs solution to these
t&o problems is both elegant and e##icient.
The Byte )o"e
The 6ey that allo&s the Fa%a to sol%e the security and portability problems is
that the output o# Fa%a compiler is 5yte code. 5yte code is a highly optimi?ed
set o# instructions designed to be executed by the Fa%a run-time system:
&hich is called the Fa%a 9irtual 'achine ;F9'<. That is: in its standard #orm:
the F9' is an interpreter #or byte code.
Translating a Fa%a program into byte code helps ma6es it much easier to run a
program in a &ide %ariety o# en%ironments. The reason is: once the run-time
pac6age exists #or a gi%en system: any Fa%a program can run on it.
Although Fa%a &as designed #or interpretation: there is technically nothing
about Fa%a that pre%ents on-the-#ly compilation o# byte code into nati%e code.
122
Sun has >ust completed its Fust In Time ;FIT< compiler #or byte code. =hen
the FIT compiler is a part o# F9': it compiles byte code into executable code in
real time: on a piece-by-piece: demand basis. It is not possible to compile an
entire Fa%a program into executable code all at once: because Fa%a per#orms
%arious run-time chec6s that can be done only at run time. The FIT compiles
code: as it is needed: during execution.
Ga*a 4irtual .a)hine <G4.(
5eyond the language: there is the Fa%a %irtual machine. The Fa%a %irtual
machine is an important element o# the Fa%a technology. The %irtual machine
can be embedded &ithin a &eb bro&ser or an operating system. nce a piece
o# Fa%a code is loaded onto a machine: it is %eri#ied. As part o# the loading
process: a class loader is in%o6ed and does byte code %eri#ication ma6es sure
that the code thatGs has been generated by the compiler &ill not corrupt the
machine that itGs loaded on. 5yte code %eri#ication ta6es place at the end o#
the compilation process to ma6e sure that is all accurate and correct. So byte
code %eri#ication is integral to the compiling and executing o# Fa%a code.
%erall $escription
(icture sho&ing the de%elopment process o# FA9A (rogram
Fa%a programming uses to produce byte codes and executes them. The #irst
box indicates that the Fa%a source code is located in a. Fa%a #ile that is
processed &ith a Fa%a compiler called >a%ac. The Fa%a compiler produces a #ile
called a. class #ile: &hich contains the byte code. The .*lass #ile is then loaded
across the net&or6 or loaded locally on your machine into the execution
123
Java Source
Java byte
code
Java1%
Java
.Class
en%ironment is the Fa%a %irtual machine: &hich interprets and executes the
byte code.
Ga*a Ar)hite)ture
Fa%a architecture pro%ides a portable: robust: high per#orming en%ironment
#or de%elopment. Fa%a pro%ides portability by compiling the byte codes #or the
Fa%a 9irtual 'achine: &hich is then interpreted on each plat#orm by the run-
time en%ironment. Fa%a is a dynamic system: able to load code &hen needed
#rom a machine in the same room or across the planet.
Compilation of )o"e
=hen you compile the code: the Fa%a compiler creates machine code ;called
byte code< #or a hypothetical machine called Fa%a 9irtual 'achine ;F9'<. The
F9' is supposed to execute the byte code. The F9' is created #or o%ercoming
the issue o# portability. The code is &ritten and compiled #or one machine and
interpreted on all machines. This machine is called Fa%a 9irtual 'achine.
*ompiling and interpreting Fa%a Source *ode
124
$uring run-time the Fa%a interpreter tric6s the byte code #ile into thin6ing that
it is running on a Fa%a 9irtual 'achine. In reality this could be a Intel (entium
=indo&s 3, or SunSAR* station running Solaris or Apple 'acintosh running
system and all could recei%e code #rom any computer through Internet and
run the Applets.
Simple
Fa%a &as designed to be easy #or the (ro#essional programmer to learn and to
use e##ecti%ely. I# you are an experienced *UU programmer: learning Fa%a &ill
be e%en easier. 5ecause Fa%a inherits the *8*UU syntax and many o# the
ob>ect oriented #eatures o# *UU. 'ost o# the con#using concepts #rom *UU are
either le#t out o# Fa%a or implemented in a cleaner: more approachable
manner. In Fa%a there are a small number o# clearly de#ined &ays to
accomplish a gi%en tas6.
O$>e)t/Oriente"
125
Source
Code
..
..
..

PC Compiler
Macintosh
Compiler
SP!C
Compiler
Java
"yte code
#Plat$orm
Independe
nt%
Java
Interpreter
#PC%
Java
Interpreter
#Macintosh%
Java
Interpreter
#Spare%
Fa%a &as not designed to be source-code compatible &ith any other language.
This allo&ed the Fa%a team the #reedom to design &ith a blan6 slate. ne
outcome o# this &as a clean usable: pragmatic approach to ob>ects. The ob>ect
model in Fa%a is simple and easy to extend: &hile simple types: such as
integers: are 6ept as high-per#ormance non-ob>ects.
Ro$ust
The multi-plat#orm en%ironment o# the =eb places extraordinary demands on
a program: because the program must execute reliably in a %ariety o#
systems. The ability to create robust programs &as gi%en a high priority in the
design o# Fa%a. Fa%a is strictly typed languageE it chec6s your code at compile
time and run time.
Fa%a %irtually eliminates the problems o# memory management and de-
allocation: &hich is completely automatic. In a &ell-&ritten Fa%a program: all
run time errors can Aand should Abe managed by your program.
126
Ga*a Data$ase Conne)ti*ity
=hat Is F$5*@
F$5* is a Fa%a A(I #or executing SV) statements. ;As a point o# interest: F$5*
is a trademar6ed name and is not an acronymE ne%ertheless: F$5* is o#ten
thought o# as standing #or Fa%a $atabase *onnecti%ity. It consists o# a set o#
classes and inter#aces &ritten in the Fa%a programming language. F$5*
pro%ides a standard A(I #or tool8database de%elopers and ma6es it possible to
&rite database applications using a pure Fa%a A(I.
.sing F$5*: it is easy to send SV) statements to %irtually any relational
database. ne can &rite a single program using the F$5* A(I: and the
program &ill be able to send SV) statements to the appropriate database. The
combinations o# Fa%a and F$5* lets a programmer &rite it once and run it
any&here.
=hat $oes F$5* $o@
Simply put: F$5* ma6es it possible to do three thingsD
Establish a connection &ith a database
Send SV) statements
(rocess the results.
F$5* %ersus $5* and other A(Is
At this point: 'icroso#tTs $5* ;pen $atabase *onnecti%ity< A(I is that
probably the most &idely used programming inter#ace #or accessing relational
databases. It o##ers the ability to connect to almost all databases on almost all
plat#orms.
127
So &hy not >ust use $5* #rom Fa%a@ The ans&er is that you can use $5*
#rom Fa%a: but this is best done &ith the help o# F$5* in the #orm o# the F$5*-
$5* 5ridge: &hich &e &ill co%er shortly. The "uestion no& becomes R=hy do
you need F$5*@R There are se%eral ans&ers to this "uestionD
1. $5* is not appropriate #or direct use #rom Fa%a because it uses a *
inter#ace. *alls #rom Fa%a to nati%e * code ha%e a number o# dra&bac6s
in the security: implementation: robustness: and automatic portability o#
applications.
2. A literal translation o# the $5* * A(I into a Fa%a A(I &ould not be
desirable. For example: Fa%a has no pointers: and $5* ma6es copious
use o# them: including the notoriously error-prone generic pointer R%oid
WR. Kou can thin6 o# F$5* as $5* translated into an ob>ect-oriented
inter#ace that is natural #or Fa%a programmers.
3. $5* is hard to learn. It mixes simple and ad%anced #eatures together:
and it has complex options e%en #or simple "ueries. F$5*: on the other
hand: &as designed to 6eep simple things simple &hile allo&ing more
ad%anced capabilities &here re"uired.
!. A Fa%a A(I li6e F$5* is needed in order to enable a Rpure Fa%aR solution.
=hen $5* is used: the $5* dri%er manager and dri%ers must be
manually installed on e%ery client machine. =hen the F$5* dri%er is
&ritten completely in Fa%a: ho&e%er: F$5* code is automatically
installable: portable: and secure on all Fa%a plat#orms #rom net&or6
computers to main#rames.
T&o-tier and Three-tier 'odels
The F$5* A(I supports both t&o-tier and three-tier models #or database
access.
In the t&o-tier model: a Fa%a applet or application tal6s directly to the
database. This re"uires a F$5* dri%er that can communicate &ith the
128
particular database management system being accessed. A userTs SV)
statements are deli%ered to the database: and the results o# those statements
are sent bac6 to the user. The database may be located on another machine
to &hich the user is connected %ia a net&or6. This is re#erred to as a
client8ser%er con#iguration: &ith the userTs machine as the client: and the
machine housing the database as the ser%er. The net&or6 can be an Intranet:
&hich: #or example: connects employees &ithin a corporation: or it can be the
Internet.
129
J&
pplication
JD"C
D"MS
Client machine
D"MS'proprietary protocol
Database server
Java applet or
(tml bro)ser
pplication
Server #Java%
JD"C
DBMS
Client machine #*+I%
(,,P- !MI- or C.!" calls
Server machine #business
/o0ic%
D"MS'proprietary protocol
Database server
In the three-tier model: commands are sent to a Rmiddle tierR o# ser%ices:
&hich then send SV) statements to the database. The database processes the
SV) statements and sends the results bac6 to the middle tier: &hich then
sends them to the user. 'IS directors #ind the three-tier model %ery attracti%e
because the middle tier ma6es it possible to maintain control o%er access and
the 6inds o# updates that can be made to corporate data. Another ad%antage
is that &hen there is a middle tier: the user can employ an easy-to-use
higher-le%el A(I &hich is translated by the middle tier into the appropriate
lo&-le%el calls. Finally: in many cases the three-tier architecture can pro%ide
per#ormance ad%antages.
.ntil no& the middle tier has typically been &ritten in languages such as * or
*UU: &hich o##er #ast per#ormance. +o&e%er: &ith the introduction o#
optimi?ing compilers that translate Fa%a byte code into e##icient machine-
speci#ic code: it is becoming practical to implement the middle tier in Fa%a.
This is a big plus: ma6ing it possible to ta6e ad%antage o# Fa%aTs robustness:
multithreading: and security #eatures. F$5* is important to allo& database
access #rom a Fa%a middle tier.
130
GDBC Dri*er Types
The F$5* dri%ers that &e are a&are o# at this time #it into one o# #our
categoriesD
F$5*-$5* bridge plus $5* dri%er
Hati%e-A(I partly-Fa%a dri%er
F$5*-Het pure Fa%a dri%er
Hati%e-protocol pure Fa%a dri%er
GDBC/ODBC Bri"ge
I# possible: use a (ure Fa%a F$5* dri%er instead o# the 5ridge and an $5*
dri%er. This completely eliminates the client con#iguration re"uired by $5*.
It also eliminates the potential that the Fa%a 9' could be corrupted by an
error in the nati%e code brought in by the 5ridge ;that is: the 5ridge nati%e
library: the $5* dri%er manager library: the $5* dri%er library: and the
database client library<.
5hat Is the GDBC/ ODBC Bri"geA
The F$5*-$5* 5ridge is a F$5* dri%er: &hich implements F$5*
operations by translating them into $5* operations. To $5* it appears
as a normal application program. The 5ridge implements F$5* #or any
database #or &hich an $5* dri%er is a%ailable. The 5ridge is implemented
as the
Sun.>dbc.odbc Fa%a pac6age and contains a nati%e library used to access
$5*. The 5ridge is a >oint de%elopment o# Innersole and Fa%a So#t.
131
GDBC )onne)ti*ity
The F$5* pro%ides database-independent connecti%ity bet&een the F2EE
plat#orm and a &ide range o# tabular data sources. F$5* technology allo&s an
Application *omponent (ro%ider toD
(er#orm connection and authentication to a database ser%er
'anager transactions
'o%e SV) statements to a database engine #or preprocessing and
execution
Execute stored procedures
Inspect and modi#y the results #rom Select statements$ase
A database management system ;$5'S< is computer so#t&are designed #or
the purpose o# managing databases: a large set o# structured data: and run
operations on the data re"uested by numerous users. Typical examples o#
$5'Ss include racle: $52: 'icroso#t Access: 'icroso#t SV) Ser%er: Firebird:
(ostgreSV): 'ySV): SV)ite: File'a6er and Sybase Adapti%e Ser%er
Enterprise. $5'Ss are typically used by $atabase administrators in the
creation o# $atabase systems. Typical examples o# $5'S use include
accounting: human resources and customer support systems.
riginally #ound only in large companies &ith the computer hard&are needed
to support large data sets: $5'Ss ha%e more recently emerged as a #airly
standard part o# any company bac6 o##ice.
Des)ription
A $5'S is a complex set o# so#t&are programs that controls the organi?ation:
storage: management: and retrie%al o# data in a database. A $5'S includesD
132
A modeling language to de#ine the schema o# each database hosted in
the $5'S: according to the $5'S data model.
The #our most common types o# organi?ations are the hierarchical:
net&or6: relational and ob>ect models. In%erted lists and other
methods are also used. A gi%en database management system may
pro%ide one or more o# the #our models. The optimal structure
depends on the natural organi?ation o# the applicationTs data: and on
the applicationTs re"uirements ;&hich include transaction rate
;speed<: reliability: maintainability: scalability: and cost<.
The dominant model in use today is the ad hoc one embedded in
SV): despite the ob>ections o# purists &ho belie%e this model is a
corruption o# the relational model: since it %iolates se%eral o# its
#undamental principles #or the sa6e o# practicality and per#ormance.
'any $5'Ss also support the pen $atabase *onnecti%ity A(I that
supports a standard &ay #or programmers to access the $5'S.
$ata structures ;#ields: records: #iles and ob>ects< optimi?ed to deal &ith
%ery large amounts o# data stored on a permanent data storage de%ice
;&hich implies relati%ely slo& access compared to %olatile main
memory<.
A database "uery language and report &riter to allo& users to
interacti%ely interrogate the database: analy?e its data and update it
according to the users pri%ileges on data.
It also controls the security o# the database.
$ata security pre%ents unauthori?ed users #rom %ie&ing or updating
the database. .sing pass&ords: users are allo&ed access to the
133
entire database or subsets o# it called subschemas. For example: an
employee database can contain all the data about an indi%idual
employee: but one group o# users may be authori?ed to %ie& only
payroll data: &hile others are allo&ed access to only &or6 history and
medical data.
I# the $5'S pro%ides a &ay to interacti%ely enter and update the
database: as &ell as interrogate it: this capability allo&s #or
managing personal databases. +o&e%er: it may not lea%e an audit
trail o# actions or pro%ide the 6inds o# controls necessary in a multi-
user organi?ation. These controls are only a%ailable &hen a set o#
application programs are customi?ed #or each data entry and
updating #unction.
A transaction mechanism: that ideally &ould guarantee the A*I$
properties: in order to ensure data integrity: despite concurrent user
accesses ;concurrency control<: and #aults ;#ault tolerance<.
It also maintains the integrity o# the data in the database.
The $5'S can maintain the integrity o# the database by not allo&ing
more than one user to update the same record at the same time. The
$5'S can help pre%ent duplicate records %ia uni"ue index
constraintsE #or example: no t&o customers &ith the same customer
numbers ;6ey #ields< can be entered into the database. See A*I$
properties #or more in#ormation ;Redundancy a%oidance<.
The $5'S accepts re"uests #or data #rom the application program and
instructs the operating system to trans#er the appropriate data.
134
=hen a $5'S is used: in#ormation systems can be changed much more easily
as the organi?ationTs in#ormation re"uirements change. He& categories o#
data can be added to the database &ithout disruption to the existing system.
rgani?ations may use one 6ind o# $5'S #or daily transaction processing and
then mo%e the detail onto another computer that uses another $5'S better
suited #or random in"uiries and analysis. %erall systems design decisions are
per#ormed by data administrators and systems analysts. $etailed database
design is per#ormed by database administrators.
$atabase ser%ers are specially designed computers that hold the actual
databases and run only the $5'S and related so#t&are. $atabase ser%ers are
usually multiprocessor computers: &ith RAI$ dis6 arrays used #or stable
storage. *onnected to one or more ser%ers %ia a high-speed channel:
hard&are database accelerators are also used in large %olume transaction
processing en%ironments.
$5'Ss are #ound at the heart o# most database applications. Sometimes
$5'Ss are built around a pri%ate multitas6ing 6ernel &ith built-in net&or6ing
support although no&adays these #unctions are le#t to the operating
system.6&
Structured Vuery )anguage ;SV)< is the language used to manipulate
relational databases. SV) is tied %ery closely &ith the relational model.
In the relational model: data is stored in structures called relations or tables.
SV) statements are issued #or the purpose o#D
135
Data "efinition: $e#ining tables and structures in the database ;$$) used to
create: alter and drop schema ob>ects such as tables and indexes<.
Data manipulation: .sed to manipulate the data &ithin those schema
ob>ects ;$') Inserting: .pdating: $eleting the data: and Vuerying the
$atabase<.
A schema is a collection o# database ob>ects that can includeD tables: %ie&s:
indexes and se"uences
)ist o# SV) statements that can be issued against an racle database schema
areD
A&TR - *hange an existing table: %ie& or index de#inition ;$$)<
AUDIT - Trac6 the changes made to a table ;$$)<
CO..NT - Add a comment to a table or column in a table
;$$)<
CO..IT - 'a6e all recent changes permanent ;$') -
transactional<
CRAT - *reate ne& database ob>ects such as tables or %ie&s
;$$)<
D&T - $elete ro&s #rom a database table ;$')<
DROP - $rop a database ob>ect such as a table: %ie& or index
;$$)<
0RANT - Allo& another user to access database ob>ects such as
tables or %ie&s ;$$)<
136
INSRT - Insert ne& data into a database table ;$')<
No AUDIT - Turn o## the auditing #unction ;$$)<
R4O= - $isallo& a user access to database ob>ects such as
tables and %ie&s ;$$)<
RO&&BAC= - .ndo any recent changes to the database ;$') -
Transactional<
S&CT - Retrie%e data #rom a database table ;$')<
TRUNCAT - $elete all ro&s #rom a database table ;can not be
rolled bac6< ;$')<
UPDAT - *hange the %alues o# some data items in a database
table R4&TS
Introduction
The Fa%a &eb ser%er is Fa%aSo#tTs o&n &eb Ser%er. The Fa%a &eb ser%er is
>ust a part o# a larger #rame&or6: intended to pro%ide you not >ust &ith a &eb
ser%er: but also &ith tools. To build customi?ed net&or6 ser%ers #or any
Internet or Intranet client8ser%er system. Ser%lets are to a &eb ser%er: ho&
applets are to the bro&ser.
About Ser%lets
Ser%lets pro%ide a Fa%a-based solution used to address the problems currently
associated &ith doing ser%er-side programming: including inextensible
scripting solutions: plat#orm-speci#ic A(Is: and incomplete inter#aces.
Ser%lets are ob>ects that con#orm to a speci#ic inter#ace that can be plugged
into a Fa%a-based ser%er. Ser%lets are to the ser%er-side &hat applets are to
the client-side - ob>ect byte codes that can be dynamically loaded o## the net.
They di##er #rom applets in that they are #aceless ob>ects ;&ithout graphics or
a J.I component<. They ser%e as plat#orm independent: dynamically loadable:
137
pluggable helper byte code ob>ects on the ser%er side that can be used to
dynamically extend ser%er-side #unctionality.
For example: an +TT( Ser%lets can be used to generate dynamic +T')
content. =hen you use Ser%lets to do dynamic content you get the #ollo&ing
ad%antagesD
TheyGre #aster and cleaner than *JI scripts
They use a standard A(I ;the Ser%lets A(I<
They pro%ide all the ad%antages o# Fa%a ;run on a %ariety o#
ser%ers &ithout needing to be re&ritten<.
Attracti%eness o# Ser%lets
There are many #eatures o# Ser%lets that ma6e them easy and attracti%e to
use. These includeD
Easily con#igured using the J.I-based Admin tool
*an be loaded and in%o6ed #rom a local dis6 or remotely across
the net&or6.
*an be lin6ed together: or chained: so that one Ser%lets can call
another Ser%lets: or se%eral Ser%lets in se"uence.
*an be called dynamically #rom &ithin +T') pages: using ser%er-
side include tags.
Are secure - e%en &hen do&nloading across the net&or6: the
Ser%lets security model and Ser%lets sandbox protect your system
#rom un#riendly beha%ior.
A"*antages of the Ser*let API
ne o# the great ad%antages o# the Ser%let A(I is protocol independence. It
assumes nothing aboutD
138
The protocol being used to transmit on the net
+o& it is loaded
The ser%er en%ironment it &ill be running in
These "ualities are important: because it allo&s the Ser%let A(I to be
embedded in many di##erent 6inds o# ser%ers. There are other ad%antages to
the Ser%let A(I as &ell. These includeD
ItGs extensible - you can inherit all your #unctionality #rom the base
classes made a%ailable to you.
ItGs simple: small: and easy to use.
#eatures of Ser*lets:
Ser%lets are persistent. Ser%let are loaded only by the &eb ser%er
and can maintain ser%ices bet&een re"uests.
Ser%lets are #ast. Since Ser%lets only need to be loaded once: they
o##er much better per#ormance o%er their *JI counterparts.
139
Ser%lets are plat#orm independent.
Ser%lets are extensible. Fa%a is a robust: ob>ect-oriented
programming language: &hich easily can be extended to suit your
needs
Ser%lets are secure.
Ser%lets can be used &ithoa"ing Ser*lets:
Ser%lets can be loaded #rom three places
From a directory that is on the *)ASS(AT+. The *)ASS(AT+ o# the
Fa%a=ebSer%er includes ser%ice root8classes8 &hich is &here the system
classes reside.
From the NSER9I*EXRT 8Ser%lets8 directory. This is WnotW in the ser%erGs
class path. A class loader is used to create Ser%lets #rom this directory. He&
Ser%lets can be added - existing Ser%lets can be recompiled and the ser%er
&ill notice these changes.
From a remote location: #or this a code base li6e httpD 88 nine.eng 8 classes 8
#oo 8 is re"uired in addition to the Ser%lets class name. Re#er to the admin
J.I docs on Ser%let section to see ho& to set this up.
&oa"ing Remote Ser*lets
Remote Ser%lets can be loaded byD
1. *on#iguring the Admin Tool to setup automatic loading o# remote
Ser%lets
2. Setting up ser%er side include tags in. shtml #iles
3. $e#ining a #ilter chain con#iguration
In*oking Ser*lets
140
A Ser%let in%o6er is a Ser%let that in%o6es the Rser%iceR method on a named
Ser%let. I# the Ser%let is not loaded in the ser%er: then the in%o6er #irst loads
the Ser%let ;either #rom local dis6 or #rom the net&or6< and the then in%o6es
the Rser%iceR method. Also li6e applets: local Ser%lets in the ser%er can be
identi#ied by >ust the class name. In other &ords: i# a Ser%let name is not
absolute: it is treated as local.
A client can in%o6e Ser%lets in the #ollo&ing &ays:
The client can as6 #or a document that is ser%ed by the Ser%let.
The client ;bro&ser< can in%o6e the Ser%let directly using a .R): once it
has been mapped using the Ser%let Aliases section o# the admin J.I.
The Ser%let can be in%o6ed through ser%er side include tags.
The Ser%let can be in%o6ed by placing it in the Ser%lets8 directory.
The Ser%let can be in%o6ed by using it in a #ilter chain.
Ga*a Ser*er Pages <GSP(
Fa%a ser%er (ages is a simple: yet po&er#ul technology #or creating and
maintaining dynamic-content &eb pages. 5ased on the Fa%a programming
language: Fa%a Ser%er (ages o##ers pro%en portability: open standards: and
a mature re-usable component model .The Fa%a Ser%er (ages architecture
enables the separation o# content generation #rom content presentation.
This separation not eases maintenance headachesE it also allo&s &eb team
members to #ocus on their areas o# expertise. Ho&: &eb page designer can
concentrate on layout: and &eb application designers on programming:
&ith minimal concern about impacting each otherGs &or6.
Features o# FS(
(ortabilityD
141
Fa%a Ser%er (ages #iles can be run on any &eb ser%er or &eb-enabled
application ser%er that pro%ides support #or them. $ubbed the FS( engine:
this support in%ol%es recognition: translation: and management o# the Fa%a
Ser%er (age li#ecycle and its interaction components.
*omponents
It &as mentioned earlier that the Fa%a Ser%er (ages architecture can
include reusable Fa%a components. The architecture also allo&s #or the
embedding o# a scripting language directly into the Fa%a Ser%er (ages #ile.
The components current supported include Fa%a 5eans: and Ser%lets.
(rocessing
A Fa%a Ser%er (ages #ile is essentially an +T') document &ith FS( scripting
or tags. The Fa%a Ser%er (ages #ile has a FS( extension to the ser%er as a
Fa%a Ser%er (ages #ile. 5e#ore the page is ser%ed: the Fa%a Ser%er (ages
syntax is parsed and processed into a Ser%let on the ser%er side. The
Ser%let that is generated outputs real content in straight +T') #or
responding to the client.
Access 'odelsD
A Fa%a Ser%er (ages #ile may be accessed in at least t&o di##erent &ays. A
clientGs re"uest comes directly into a Fa%a Ser%er (age. In this scenario:
suppose the page accesses reusable Fa%a 5ean components that per#orm
particular &ell-de#ined computations li6e accessing a database. The result
o# the 5eans computations: called result sets is stored &ithin the 5ean as
properties. The page uses such 5eans to generate dynamic content and
present it bac6 to the client.
142
In both o# the abo%e cases: the page could also contain any %alid Fa%a
code. Fa%a Ser%er (ages architecture encourages separation o# content
#rom presentation.
Steps in the execution o# a FS( ApplicationD
1. The client sends a re"uest to the &eb ser%er #or a FS( #ile by gi%ing the
name o# the FS( #ile &ithin the #orm tag o# a +T') page.
2. This re"uest is trans#erred to the Fa%a=ebSer%er. At the ser%er side
Fa%a=ebSer%er recei%es the re"uest and i# it is a re"uest #or a >sp #ile
ser%er gi%es this re"uest to the FS( engine.
143
3. FS( engine is program &hich can under stands the tags o# the >sp and
then it con%erts those tags into a Ser%let program and it is stored at the
ser%er side. This Ser%let is loaded in the memory and then it is executed
and the result is gi%en bac6 to the Fa%a=ebSer%er and then it is
trans#erred bac6 to the result is gi%en bac6 to the Fa%a=ebSer%er and
then it is trans#erred bac6 to the client.
144
A$out Struts:
5hat is a 5e$ Appli)ationA
Applications built using the Struts #rame&or6 are at their core: &eb
applications. A web application is a collection o# indi%idual components that
once bound together: #orm a complete application that can be installed and
executed by a &eb container. The components are tied together due to the
#act that they reside in the same &eb context and in many cases: may re#er to
one another: directly or indirectly.
lements of a 5e$ Appli)ation
b%iously: not all &eb applications are created e"ual. They &ill not ha%e the
same #unctional and non-#unctional re"uirements across organi?ations:
departments: or e%en the same %ertical mar6ets. There#ore: not all &eb
applications &ill contain the same types o# resources. In general ho&e%er:
&eb applications can consist o# one or more o# the #ollo&ing types o#
componentsD
Ser%lets
FS( (ages
Standard Fa%a5eans and .tility *lasses
+T') $ocuments
'ultimedia Files ;Images: Audio and 9ideo Files: *A$ $ra&ings: etc7 <
*lient side Applets: Stylesheets: and Fa%aScript Files
Text $ocuments
'eta in#ormation that ties all o# the abo%e components together
GSP .o"el 1 an" .o"el 9 Ar)hite)tures:
145
The early FS( speci#ications presented t&o approaches #or building &eb
applications using FS( technology. These t&o approaches &ere described in
the speci#ication as FS( 'odel 1 and 'odel 2 architectures. Although the
terms are no longer used in the FS( speci#ication: their usage throughout the
&eb tier de%elopment community is still &idely used and re#erenced.
The t&o FS( architectures di##ered in se%eral 6ey areas. The ma>or di##erence
&as ho& and by &hich component the processing o# a re"uest &as handled.
=ith the 'odel 1architecture: the FS( page handles all o# the processing o# the
re"uest and is also responsible #or displaying the output to the client.
In direct comparison to the 'odel 1 approach: in the 'odel 2 architecture: the
client re"uest is #irst intercepted by a ser%let: most o#ten re#erred to as a
*ontroller ser%let. The ser%let handles the initial processing o# the re"uest and
also determines &hich FS( page to display next.
As you can see #rom the abo%e #igure: in the 'odel 2 architecture: a client
ne%er sends a re"uest directly to a FS( page. The controller ser%let acts as
sort o# a tra##ic cop. This allo&s the ser%let to per#orm #ront-end processing
li6e authentication and authori?ation: centrali?ed logging: and possibly help
&ith Internationali?ation. nce processing o# the re"uest has #inished: the
146
ser%let directs the re"uest to the appropriate FS( page. +o& exactly the next
page is determined can %ary &idely across di##erent applications. For example:
in simpler applications: the next FS( page to display may be hard coded in the
ser%let based on the re"uest: parameters: and current application state. In
other more sophisticated &eb applications: a &or6#lo&8rules engine may be
used.
As you can see: the main di##erence bet&een the t&o approaches is that the
'odel 2 architecture introduces a controller ser%let that pro%ides a single
point o# entry and also encourages more reuse and extensibility than 'odel 1.
=ith the 'odel 2 architecture: there is also a clear separation o# the business
logic: presentation output: and re"uest processing. This separation is o#ten
re#erred to as a 'odel-9ie&-*ontroller ;'9*< pattern. =hile the 'odel 2
architecture might seem o%erly complicated: it can actually simpli#y an
application greatly. =eb applications built using the 'odel 2 approach are
generally easier to maintain and can be more extensible than comparable
applications built around the 'odel 1 architecture.
All o# this doesnGt mean that applications built using the 'odel 1 approach are
incorrectly designed. The 'odel 1 architecture might be the best decision #or
smaller applications that ha%e simple page na%igation: no need #or centrali?ed
#eatures: and are #airly static. +o&e%er: #or more larger enterprise-si?e &eb
applications: it &ould be more ad%antageous to utili?e the 'odel 2 approach.
5hy is .o"el/4ie+/Controller So ImportantA
'odel-9ie&-*ontroller is an architectural pattern that by it sel# has nothing to
do &ith &eb applications directly. As &e sa& #rom the pre%ious section: the
FS( 'odel 2 approach is clearly about separating responsibilities in a &eb
application built using Ser%let and FS( technologies. Allo&ing a FS( page to
handle the responsibilities o# recei%ing the re"uest: executing some business
logic: and then determining the next %ie& to display can really ma6e #or an
unattracti%e FS( page: not to mention the problems this entanglement causes
#or maintenance and extensibility. 5y ha%ing components &ithin a &eb
147
application that ha%e %ery clear and distinct responsibilities: the de%elopment
and maintenance on an application can be made more e##icient. This is also
true #or so#t&are de%elopment as a &hole. The '9* pattern is categori?ed as
a design pattern in many so#t&are design boo6s. Although there is usually
much disagreement on the precise de#inition o# the pattern: there are some
#undamental ideas.
The '9* pattern has three 6ey componentsD
The .o"el Component
Responsible #or the business domain state 6no&ledge
The 4ie+ Component
Responsible #or a presentation %ie& o# the business domain
The Controller Component
Responsible #or controlling #lo& and state o# the user input
Hormally &ith the '9* pattern: thereGs a #orm o# e%ent noti#ication that ta6es
place to noti#y the %ie& &hen some portion o# the model changes. +o&e%er:
since a bro&ser in a typical &eb application has a stateless connection: the
noti#ication #rom the model to the %ie& canGt easily occur. # course: an
application could per#orm some type o# push action to push data changes all
the &ay to a clientE but this doesnGt and probably shouldnGt happen in most
&eb applications. A user can close at a bro&ser anytime and there isnGt
&arning or noti#ication sent to the ser%er. ThereGs a great deal o# o%erhead
necessary to management remote clients #rom the ser%er side. This type o#
beha%ior is o%er6ill #or typical 52* and 525 &eb applications.

The .4C .o"el
$epending on the type o# architecture o# your application: the model portion
o# the '9* pattern can ta6e many di##erent #orms. In a t&o-tier application:
&here the &eb tier interacts directly &ith a data store li6e a database: the
model classes may be a set o# regular Fa%a ob>ects. These ob>ects may be
populated manually #rom a result set returned by a database "uery or they
148
can e%en be instantiated and populated automatically by an b>ect-to-
Relational 'apping ;R'< #rame&or6.
In a more complex enterprise application &here the &eb tier communicates
&ith an EF5 ser%er #or example: the model portion o# the '9* pattern might
be Enterprise Fa%a5eans. Although the EF5 2.4 Speci#ication made some
impro%ements in per#ormance through the use o# local inter#aces: there can
still be a signi#icant per#ormance impact i# the &eb tier attempted to use entity
beans directly as the model portion o# the application. In many cases:
Fa%a5eans are returned #rom Session beans and used &ithin the &eb tier.
These Fa%a5eans are commonly re#erred to as %alue ob>ects and are used
&ithin the %ie&s to build the dynamic content.
The .4C 4ie+
The %ie&s &ithin the &eb tier '9* pattern typically consist o# +T') and FS(
pages. +T') pages are used to ser%e static content: &hile FS( pages can be
used to ser%e both static and dynamic content. 'ost dynamic content is
generated in the &eb tier. +o&e%er: =eb applications are considered stateless
because the bro&ser doesnGt typically maintain an open soc6et to the &eb
ser%er. +o&e%er: a &eb application may still maintain session data #or a user
or e%en store data &ithin the bro&ser on behal# o# the user. some applications
may re"uire the need #or client-side Fa%aScript. This does not inter#ace or
in#ringe upon the '9* concept.
The .4C Controller
The controller portion o# the &eb tier '9* design is generally a Fa%a ser%let.
The controller in a &eb tier application per#orms the #ollo&ing dutiesD
1. Intercepts +TT( re"uests #rom a client.
2. Translates the re"uest into a speci#ic business operation to per#orm.
3. Either in%o6es the business operation itsel# or delegates to a handler.
149
!. +elps to select the next %ie& to display to the client.
,. Returns the %ie& to the client.
The Front *ontroller pattern: &hich is part o# the F2EE $esign (atterns:
describes ho& a &eb tier controller should be implemented. Since all client
re"uests and responses go through the controller: there is a centrali?ed point
o# control #or the &eb application. This aides in maintenance and &hen adding
ne& #unctionality. *ode that &ould normally need to be put in e%ery FS( page
can be put in the controller ser%let: since it processes all re"uests. The
controller also helps to decouple the presentation components ;%ie&s< #rom
the business operations: &hich also aids de%elopment.
5hat is a #rame+orkA
I ha%e been thro&ing the &ord #rame&or6 around in this chapter &ithout
ha%ing really de#ined &hat exactly it is or ho& it adds %alue in so#t&are
de%elopment. In its simplest #orm: a #rame&or6 is a set o# classes and
inter#aces that cooperate to sol%e a speci#ic type o# so#t&are problem. A
#rame&or6 has the #ollo&ing characteristicsD
A #rame&or6 is made up o# multiple classes or components: each o#
&hich may (ro%ide an abstraction o# some particular concept.
The #rame&or6 de#ines ho& these abstractions &or6 together to sol%e a
problem.
The #rame&or6 components are reusable
A good #rame&or6 should pro%ide generic beha%ior that can be utili?ed across
many di##erent types o# applications. There are many interpretations o# &hat
constitutes a #rame&or6. Some might consider the classes and inter#aces
pro%ided by the Fa%a language a #rame&or6: but itGs really a library. ThereGs a
subtle: but %ery distinct di##erence bet&een a so#t&are library and a
150
#rame&or6. =ith a so#t&are library: your application is the main code that
executes and it in%o6es routines on the library. =ith a #rame&or6: it contains
the executing routines and in%o6es operations onto your extensions through
inheritance and other means. The places &here the #rame&or6 can be
extended are 6no&n as extension points. A #rame&or6 is commonly re#erred
to an Bupside-do&nC library because o# the alternate manner in &hich it
operates.
Creation of the Struts #rame+ork
5y no& you should ha%e a #oundation #or FS( and Ser%let technology and you
should also understand the bene#its that the =eb '9* design and FS( 'odel 2
architecture adds to a &eb application. This section pro%ides a little
bac6ground and history on the Struts #rame&or6: &hich is an implementation
o# all o# these ideas.
%igh/le*el Diagram of Struts #rame+ork:
Typi)al Diagram of Struts #rame+ork:
151
The Struts Component Pa)kages
152
The Struts #rame&or6 is made up o# approximately 244 Fa%a classes: di%ided
into 1, Fa%a pac6ages. Approximately is an appropriate term because the
#rame&or6 is continuously gro&ing and being shaped.
Struts Controller Components
The controller component in a '9* application has se%eral Responsibilities.
Those responsibilities include recei%ing input #rom a client: in%o6ing a business
operation: and coordinating the %ie& to return bac6 to the client. # course:
there are many other #unctions that the controller may per#orm: but these are
a #e& o# the primary ones.
Kou also learned that: &ith the FS( 'odel 2 architecture: on &hich Struts &as
#ashioned the controller &as implemented by a Fa%a ser%let. This ser%let
becomes the centrali?ed point o# control #or the &eb application. The controller
ser%let maps user actions into business operations and then helps to select
the %ie& to return to the client based on the re"uest and other state
in#ormation.
In the Struts #rame&or6 ho&e%er: the controller responsibilities are
implemented by se%eral di##erent components: one o# &hich is an instance o#
the org.apache.struts.action.ActionSer%let class.
The Struts A)tionSer*let
The ActionSer%let extends the >a%ax.ser%let.http.+ttpSer%let class and is
responsible #or pac6aging and routing +TT( tra##ic to the appropriate handler
in the #rame&or6. The ActionSer%let class is not abstract and there#ore can be
used as a concrete controller by your applications. (rior to %ersion 1.1 o# the
Struts #rame&or6: the ActionSer%let &as solely responsible #or recei%ing the
re"uest and processing it by calling the appropriate handler. In %ersion 1.1: a
ne& class called org.apache.struts.action.Re"uest(rocessor has been
introduced to process the re"uest #or the controller. The main reason #or
decoupling the re"uest processing #rom the ActionSer%let is to pro%ide you
153
&ith the #lexibility to subclass the Re"uest(rocessor &ith your o&n %ersion
and modi#y ho& the re"uest is processed. For the ban6ing application
example: &e are going to 6eep it simple and utili?e the de#ault ActionSer%let
and Re"uest(rocessor classes pro%ided by the #rame&or6.
nce the controller recei%es a client re"uest: it delegates the handling o# the
re"uest to a helper class. This helper 6no&s ho& to execute the business
operation that is associated &ith the re"uested action. In the Struts
#rame&or6: this helper class is a descendant o# the
org.apache.struts.action.Action class.
Struts A)tion Classes
An org.apache.struts.action.Action class in the Struts #rame&or6 is an
extension o# the controller component. It acts as an Adaptor bet&een a user
action and a business operation. The Action class decouples the client re"uest
#rom the business model. This decoupling allo&s #or more than a one-to-one
mapping bet&een the user re"uest and an Action class. The Action class can
per#orm other #unctions: such as
authori?ation: logging: and session %alidation: be#ore in%o6ing the business
operation.
The Struts Action class contains se%eral methods: but the most important is
the execute;< method. +ere is the method signatureD
public ActionForward execute(ActionMapping mapping,
ActionForm form, HttpServletRequest request,
HttpServletResponse response t!rows "#$xception, Servlet$xception%
154
The execute;< method is called on an instance o# an Action class by the
controller &hen a re"uest is recei%ed #rom a client. The controller &ill create
an instance o# the Action class i# one doesnGt already exist. The Struts
#rame&or6 &ill only create a single instance o# each Action class in your
application. Since there is only one instance #or all users: you must ensure
that all o# your Action classes operate properly in a multi-threaded
En%ironment Although the execute;< method is not abstract: the de#ault
implementation >ust returns null so you &ill need to create your o&n Action
class implementations and o%erride this method.
.apping the A)tions
At this point: you might be as6ing yoursel#: B+o& does the controller 6no&
&hich Action instance to in%o6e &hen it recei%es a re"uest@C The ans&er is by
inspecting the re"uest in#ormation and utili?ing a set o# action mappings.
Action mappings are part o# the Struts con#iguration in#ormation that is
con#igured in a special I') #ile. This con#iguration in#ormation is loaded into
memory at startup and made a%ailable to the #rame&or6 at runtime. Each
NactionP element is represented in memory by an instance o# the
org.apache.struts.action.Action'apping class. The Action'apping ob>ect
contains a path attribute that is matched against a portion o# the .RI o# the
incoming re"uest.
=hene%er the controller recei%es a re"uest &here the path in the .RI contains
the string B8loginC: the execute;< method o# the )oginAction instance &ill be
in%o6ed. The Struts #rame&or6 also uses the mappings to identi#y the
resource to #or&ard the user to once the action has completed.
Determining the Ne!t 4ie+
=eG%e tal6ed about ho& the controller recei%es the re"uest and ho& the action
mappings and re"uest in#ormation are used to determine the correct action
instance to in%o6e and pass the re"uest to. =hat hasnGt been discussed is ho&
or &hat determines the %ie& to return bac6 to the client. I# you loo6ed closely
at the execute;< method signature in the Action class #rom the pre%ious
section: you might ha%e noticed that the return type #or the method is an
org.apache.struts.action.ActionFor&ard class. The ActionFor&ard class
represents a destination to &hich the controller may send control once an
155
Action has completed. Instead o# speci#ying an actual FS( page in the code:
you can declarati%ely associate an action #or&ard mapping &ith the FS( and
then use that ActionFor&ardthroughout your application. The action #or&ards
are speci#ied in the con#iguration #ile: similar to action mappings.
The logout action declares a N#or&ardP element that is named BSuccessC:
&hich #or&ards to a resource o# &'login.(sp). Hotice in this case: a redirect
attribute is set to BtrueC. Instead o# per#orming a #or&ard using a
Re"uest$ispatcher: the re"uest that in%o6es the logout action mapping &ill be
redirected instead.
The action #or&ard mappings can also be speci#ied in a global section
independent o# any speci#ic action mapping. In the pre%ious case: only the
logout action mapping could re#erence the action #or&ard named BSuccessC. In
the case o# #or&ards declared in the global #or&ards section: all action
mappings can re#erence them. +ere is an example global #or&ards section
#rom the con#iguration #ileD
Nglobal-#or&ardsP
N#or&ard nameSRSystemFailureR pathSR8systemerror.>spR 8P
N#or&ard nameSRSessionTimeutR pathSR8sessiontimeout.>spR 8P
N8global-#or&ardsP
The #or&ards de#ined in the global section are more general and donGt apply to
a speci#ic action. Hotice that e%ery #or&ard must ha%e a name and path: but
the redirect #lag is optional. I# you donGt speci#y a redirect attribute: its de#ault
%alue is #alse and thus per#orms a #or&ard. The path attribute in an
ActionFor&ard can also speci#y another Struts Action.
Struts .o"el Components
There are se%eral di##erent &ays to loo6 at &hat constitutes a model #or
Struts. The lines bet&een business and presentation ob>ects can get "uite
blurry &hen dealing &ith &eb applications. ne applicationGs business ob>ects
are anotherGs %alue ob>ects. ItGs important to 6eep the business ob>ects
separate #rom the presentation: so that the application is not tightly coupled
156
to one type o# presentation. ItGs %ery li6ely that the loo6 and #eel o# a &eb site
&ill change o%er time. Studies sho& that the #reshness o# a &eb
siteGs appearance helps to attract ne& customers and also 6eep existing
customers coming bac6. This may not be as true in the *usiness+to+*usiness
;525< &orld: but itGs de#initely true #or *usiness+to+,onsumer ;52*<
applications: &hich ma6e up the ma>ority o# the &eb applications used today.
The Struts 4ie+ Components
The last o# the '9* components to discuss are the Struts 9ie& components.
Arguably: itGs the easiest to understand. The %ie& components that are
typically employed in a Struts application areD
Fa%aSer%er (ages
*ustom Tags
+T')
Fa%a Resource 5undles
Struts Action Forms
9alue b>ects
Using the Struts A)tion#orm
Struts ActionForm ob>ects are used in the #rame&or6 to pass client input data
bac6 and #orth bet&een the user and the business layer. The #rame&or6 &ill
automatically collect the input #rom the re"uest and pass this data onto an
Action using a #orm bean: &hich then can be passed along to the business
layer. To 6eep the presentation layer decoupled #rom the business layer: you
should not pass the action #orm itsel# to the business layer: but rather create
the appropriate %alue ob>ects using the data #rom the #orm and pass these
ob>ects as argument to the business layer. The #ollo&ing steps
157
illustrate ho& the #rame&or6 processes an ActionForm #or e%ery re"uest.
1. *hec6 the mapping #or the action and see i# a #orm bean has been
con#igured #or it.
2. I# so: use the name attribute to loo6up the #orm bean con#iguration
in#ormation.
3. $epending on the scope con#igured #or the #orm bean #or the action: chec6
to see i# thereGs already an instance o# the #orm bean at the appropriate
scope.
!. I# an ActionForm instance is present in the appropriate scope and itGs the
same type as needed #or this ne& re"uest: reuse it.
,. ther&ise: create a ne& instance o# the re"uired #orm bean and store it
into the appropriate scope that is set by the scope attribute #or the action
mapping.
/. The reset;< method is called on the ActionForm instance.
0. Iterate through the re"uest parameters and #or e%ery parameter name that
has a corresponding set method name on the ActionForm: populate it &ith the
%alue #or that parameter.
1. Finally: i# the %alidate attribute is set to true: then in%o6e the %alidate;<
method on the ActionForm instance and return any errors.
Using Ga*aSer*er Pages for Presentation
Fa%aSer%er (ages ma6e up the ma>ority o# &hat has to be built #or the Struts
%ie& components. *ombined &ith custom tag libraries and +T'): it becomes
easy to pro%ide a set o# %ie&s #or an application. Although Fa%aSer%er (ages
ma6e up the ma>ority o# &hat organi?ations and de%elopers are using to
display the dynamic content: itGs not the only technology. There are other
#orms o# presentation technologies that can be combined &ith the Struts
#rame&or6. ne %ery popular one is the I')8IS)T combination. This alternate
model is being re#erred to as 'odel 2I: &hich is a combination o# the
controller ser%let #rom the Struts #rame&or6 and IS)T and beans seriali?ed
158
#rom the %alue ob>ects to render the %ie&s. 'any de%elopers #eel that FS( has
the #ollo&ing problemsD
$e%elopers are #ree to embed application logic into the FS( pages. This
can lead to an application that is di##icult to maintain.
FS( syntax is not currently I') compliant: &hich may cause the I') or
+T') that gets generated: not to be Bwell formed).
$e%elopers must learn the FS( syntax and ho& to program custom tags.
$e%eloping a processing pipeline &here each node in the pipeline may
modi#y the data or layout is not possible &ith FS( pages. This ma6es it
di##icult to separate layout and style.
A recompile o# the FS( page is necessary #or each change made to the page.
Custom Tag &i$raries
The Struts #rame&or6 pro%ides #i%e core tag libraries that can be used by your
applications. Each one has a di##erent purpose and can be used indi%idually or
along side the others. Kou may also create your o&n custom tags and can
e%en extend the Struts tags i# you need them to per#orm extra #unctionality.
The custom tag libraries that are included &ith the #rame&or6 areD
1< +T') Tag )ibrary
2< 5ean Tag )ibrary
3< )ogic Tag )ibrary
!< Template Tag )ibrary
,< Hested Tag )ibrary
.nless you are planning on using templates as part o# your application: the
Template Tag library might not be necessary: but the others are in%aluable to
ma6ing your application easy to de%elop and maintain.
To use the libraries in your application: you need to #irst register them &ith
the &eb application. To do this: you should add the #ollo&ing lines to the
159
deployment descriptor #or each &eb application that you &ish to use Struts
#or.
N&eb-appP
NtaglibP
Ntaglib-uriP8=E5-IHF8struts-html.tldN8taglib-uriP
Ntaglib-locationP8=E5-IHF8struts-html.tldN8taglib-locationP
N8taglibP
NtaglibP
Ntaglib-uriP8=E5-IHF8struts-bean.tldN8taglib-uriP
Ntaglib-locationP8=E5-IHF8struts-bean.tldN8taglib-locationP
N8taglibP
NtaglibP
Ntaglib-uriP8=E5-IHF8struts-logic.tldN8taglib-uriP
Ntaglib-locationP8=E5-IHF8struts-logic.tldN8taglib-locationP
N8taglibP
NtaglibP
Ntaglib-uriP8=E5-IHF8struts-template.tldN8taglib-uriP
Ntaglib-locationP8=E5-IHF8struts-template.tldN8taglib-locationP
N8taglibP
NtaglibP
Ntaglib-uriP8=E5-IHF8struts-nested.tldN8taglib-uriP
Ntaglib-locationP8=E5-IHF8struts-nested.tldN8taglib-locationP
N8taglibP
N8&eb-appP
160
The next step is to create your FS( pages and include the #ollo&ing lines.
NYZ taglib uriSR8=E5-IHF8struts-bean.tldR pre#ixSRbeanR YP
NYZ taglib uriSR8=E5-IHF8struts-html.tldR pre#ixSRhtmlR YP
NYZ taglib uriSR8=E5-IHF8struts-logic.tldR pre#ixSRlogicR YP
NYZ taglib uriSR8=E5-IHF8struts-nested.tldR pre#ixSRnestedR YP
nce this is done and the Struts FAR #ile is in the &eb applicationGs
*)ASS(AT+: you are then able to use the custom tags in your FS( pages.
.essage Resour)e Bun"les
The Fa%a library includes a set o# classes to support reading message
resources #rom either a Fa%a class or a properties #ile. The core class in this
set is the >a%a.util.Resource5undle. The Struts #rame&or6 pro%ides a similar
set o# classes: based around the org.apache.struts.util.'essageResources
class
that pro%ides similar #unctionality: but pro%ides #or a little more #lexibility that
the #rame&or6 re"uires.
The standard Fa%a support #or Internationali?ation has gro&n &ith the past
se%eral releases and the Struts #rame&or6 could probably use &hatGs included
&ith 1.2 and ne&er: but since Struts &as created be#ore 1.2: they had to build
in their o&n support #or se%eral 6ey pieces. =ith a Struts application: you
must pro%ide a Fa%a message bundle #or each language that
you &ish to support A message resource bundle is used #or reasons other than
>ust #or locali?ation. It can also sa%e time during application maintenance. For
example: i# you use the same text messages or labels throughout %arious
parts o# your &eb site or application: &hen one or more o# these %alues need
to change: you only need to ma6e the change in a single location. E%en i# you
donGt ha%e re"uirements #or Internationali?ation: you should still utili?e
resource bundles.
=ith Struts 1.1: you no& ha%e the ability to de#ine multiple 'essageResources
#or an application. This allo&s you isolate certain types o# resources: into
separate bundles. For example: you might &ant to store the image resources
161
#or an application into one bundle and the rest o# the resources into another.
+o& you organi?e your applicationGs resources is up to you: but you no& ha%e
the #lexibility to separate them based on some criteria. Some applications
choose to separate along components lines
.ultiple Appli)ation Support
(rior to %ersion 1.1: each Struts application &as limited to ha%ing a single
con#iguration #ile. The single instance o# the #ile: &hich is normally called
struts+config.xml: &as speci#ied in the &eb application deployment descriptor.
It &as the sole pro%ider o# the con#iguration in#ormation #or the Struts
application. The #act that there &as only a single place to put con#iguration
in#ormation made it %ery di##icult #or larger pro>ects because it
o#ten became a bottlenec6 and caused contentions to use and modi#y this #ile.
=ith the creation o# 1.1: this problem has been alle%iated &ith the ad%ent o#
multi application support. Kou can no& de#ine multiple con#iguration #iles and
allo& de%elopers to &or6 better in parallel.
Configuring the Struts Appli)ation
The Struts #rame&or6 uses t&o separate: but some&hat related types o#
con#iguration #iles: &hich must be properly con#igured be#ore an application
&ill #unction properly. $ue to the popularity and #lexibility o# the sel#-
describing nature o# I'): both o# these con#iguration #iles are based on I').
The &eb application deployment descriptor web.xml is described #ully in the
Fa%a Ser%let speci#ication. This con#iguration #ile is necessary #or all &eb
applications: not >ust those built &ith the Struts #rame&or6. There is ho&e%er:
Struts speci#ic deployment in#ormation that must be con#igured &ithin it &hen
building &eb applications using Struts.
The second con#iguration #ile is the Struts con#iguration #ile: commonly named
struts+config.xml. As youGll see ho&e%er: the name can be >ust about anything
that you &ant it to. The Struts con#iguration #ile ma6es it possible #or you to
declarati%ely con#igure many o# your applicationGs settings. Kou can thin6 o#
the Struts con#iguration #ile as the rules #or the &eb application.
Template for struts/)onfig2!ml file:
162

Nstruts-con#igP
Ndata-sourcesP
N#orm-beansP
Nglobal-exceptionsP
Nglobal-#or&ardsP
Naction-mappingsP
NcontrollerP
Nmessage-resourcesP
Nplug-inP
N8struts-con#igP
Hote that &e ha%e to #ollo& the abo%e order strictly: other&ise it &ill thro&
exceptions.
5hat are A)tion#ormsA
Almost e%ery &eb application has a re"uirement to accept input #rom users.
Some examples o# user input are credit card in#ormation: billing and shipping
address in#ormation: or e%en something as small as a username and
pass&ord. The +T') language pro%ides the necessary components to render
the input #ields in a bro&ser: including text boxes: radio buttons: chec6 boxes:
buttons: and many more. =hen building these types o# pages: the input
components must be nested inside o# an +T') #orm
Elements. The Struts #rame&or6 relies on the
org.apache.struts.action.ActionForm class as the 6ey component #or
handling these tas6s.
163
The ActionForm class is used to capture input data #rom an +T') #orm and
trans#er it to the Action class. Since the +T') input components donGt nati%ely
include an input bu##er and users "uite o#ten enter in%alid data: &eb
applications need a &ay to store the input data temporarily: so that it can be
redisplayed &hen an error occurs. In this sense: the ActionForm class acts as
a bu##er to hold the state o# &hat the user entered &hile it is being %alidated.
The ActionForm also acts as a B#ire&allC #or your application in that it helps to
6eep suspect or in%alid input out o# your business tier until it can be
scrutini?ed by the %alidation rules. Finally: the ActionForm is also used to
trans#er data #rom the Action class bac6 to the +T') #orm. This allo&s more
consistency #or your +T') #orms: because they are al&ays pulling data #rom
the ActionForm. =hen the user input data does pass input %alidation: the
ActionForm is passed into the execute;< method o# the Action class. From
there: the data can be retrie%ed #rom the ActionForm and passed on to the
business tier. 5ecause the ActionForm imports pac6ages #rom the Ser%let A(I:
you shouldnGt pass the ActionForm to the business tier. $oing so &ould couple
the business methods to the Ser%let A(I and ma6e it more di##icult to reuse
the business tier components. Instead: the data &ithin the ActionForm should
be trans#erred to an ob>ect #rom the domain model instead o# being passed as
an argument to the business tier. A common approach is to create a data
trans#er ob>ect and populate it &ith the data #rom the ActionForm. Kou donGt
ha%e to declare an ActionForm #or e%ery +T') #orm in your application. The
same ActionForm can be associated &ith one or more action mappings. This
means that they can be shared across multiple +T') #orms. For example: i#
you had a &i?ard inter#ace: &here a set o# data &as entered and posted
across multiple pages: a single ActionForm can be used to capture all o# this
data: a #e& #ields at a time.
A)tion#orms an" S)ope
ActionForms can ha%e t&o di##erent le%els o# scope: re"uest and session. I#
re"uest scope is used: an ActionForm &ill only be a%ailable until the end o# the
re"uest8response cycle. nce the response has been returned to the client:
the ActionForm and the data &ithin it is no longer accessible.
I# you need to 6eep the #orm data around longer than the re"uest: you can
con#igure an ActionForm to ha%e session scope. This might be necessary i#
your application captures data across multiple pages: similar to a &i?ard
dialog. An ActionForm that has been con#igured &ith session scope &ill remain
in the session until itGs remo%ed: replaced &ith another ob>ect: or until the
164
session times out. The #rame&or6 doesnGt ha%e a built-in #acility #or cleaning
up session scoped ActionForm ob>ects automatically. )i6e any other ob>ect
placed into the +ttpSession: itGs up to the application to routinely per#orm
clean up on the resources stored there. This is slightly di##erent #rom ob>ects
placed into the re"uest: because once the re"uest is #inished: they can be
reclaimed by the garbage collector since they can no longer be re#erenced.
.nless you need to speci#ically hold the #orm data across multiple re"uests:
you should use re"uest scope #or your ActionForm ob>ects.
=hen the controller recei%es a re"uest: it &ill attempt to recycle an
ActionForm instance #rom either the re"uest or the session: depending on the
scope that the ActionForm has in the action element. I# no instance is #ound: a
ne& instance &ill be created.
Creating an A)tion#orm
The ActionForm class pro%ided by the Struts #rame&or6 is abstract. Kou
need to create subclasses o# it to capture your application speci#ic #orm data.
=ithin your subclass: you should de#ine a property #or each #ield that you &ish
to capture #rom the +T') #orm.
The ActionForm is populated #rom re"uest parameters: not re"uest
attributes. I# you are #or&arding #rom one action to anther: you *an2ta33 a
re"uest attribute and expect that the ActionForm &ill be populated #rom it.
Re"uest parameters and re"uest attributes are t&o separate resources.
The A)tion#orm *ali"ate<( .etho"
The %alidate;< method may be called by the Re"uest(rocessor #or e%ery
re"uest. =hether itGs called or not depends on t&o things. First: an
ActionForm must be con#igured #or an action mapping. This means that the
name attribute #or an action element must correspond to the name attribute
o# one o# the #orm-bean elements in the con#iguration #ile.
The second condition that must be met be#ore the Re"uest(rocessor &ill
in%o6e the %alidate;< method is that the %alidate attribute must ha%e a %alue
o# BtrueC.
-action
165
pat!./'signin/ t0pe./ 1oginAction/ scope./request/ name./loginForm/
validate./true/ input./'securit0'signin.(sp/2
-forward name./Success/ pat!./'index.(sp/ redirect./true/'2
-forward name./Failure/ pat!./'securit0'signin.(sp/ redirect./true/'2
-'action2
=hen the signin action is in%o6ed: the #rame&or6 &ill populate an instance o#
a )oginForm using %alues it #inds in the re"uest. 5ecause the %alidate
attribute has a %alue o# BtrueC: the %alidate;< method in the )oginForm &ill be
called. E%en i# the %alidate attribute is set to B#alseC: the ActionForm &ill still
be populated #rom the re"uest i# an ActionForm is con#igured #or the action.
The %alidate;< method in the base ActionForm class simply returns null. I# you
&ant to per#orm %alidation on the data that is submitted &ith the re"uest:
youGll need to o%erride the %alidate;< method in your ActionForm subclasses.
The %alidate;< method may return an ActionErrors ob>ect: depending on
&hether or not any %alidation errors &ere detected. Kou also can return null i#
there are no errorsE the #rame&or6 &ill chec6 #or both null and an empty
ActionErrors ob>ect. This sa%es you #rom ha%ing to create an instance o#
ActionErrors &hen there are no errors.
The A)tion#orm reset<( .etho"
The reset;< method has been a bane #or much o# the Struts user
community at one time or another. Exactly &hen the reset;< method is called
and &hat should be done &ithin it is almost al&ays misinterpreted. This
doesnGt mean that one implementation is more correct than another: but there
are misconceptions that many ne& Struts de%elopers pic6 up and then ha%e a
hard time sha6ing regarding the reset;<.
ItGs called be#ore the ActionForm has been populated #rom the re"uest. The
method &as added to the ActionForm class originally to help #acilitate
resetting boolean properties bac6 to their de#aults. To understand &hy they
need to be reset: itGs help#ul to 6no& ho& the bro&ser and the +T') #orm
submit operation processes chec6boxes. =hen an +T') #orm contains
166
chec6boxes: only the %alues #or the chec6boxes that are chec6ed are sent in
the re"uest. Those that are not chec6ed are not included as a re"uest
parameter. There#ore: the reset;< method &as added to allo& applications to
reset the boolean properties in the ActionForm bac6 to #alse: since #alse
&asnGt included in the re"uest and the boolean %alues &ould possibly be stuc6
in the BtrueC state. The reset;< method in the base ActionForm contains no
de#ault beha%ior: since no properties are de#ined in this abstract class.
Applications that extend the ActionForm class are allo&ed to o%erride this
method and reset the ActionForm properties to &hate%er state they &ish. This
may include setting boolean properties to true or #alse: setting String %alues
to null or some initiali?ed %alue: or e%en instantiating instances o# other
ob>ects that the ActionForm holds on to. For an ActionForm that has been
con#igured &ith re"uest scope: the #rame&or6 &ill essentially create a ne&
instance #or each ne& re"uest. Since a ne& instance is created: thereGs not
much need to reset;< the %alues bac6 to any de#ault state. ActionForms that
are con#igured &ith session scope are di##erent ho&e%er. This is the time that
the reset;< method comes in handy.
De)laring A)tion#orms in the Struts Configuration #ile
nce you ha%e created a class that extends ActionForm: you need to
con#igure the class in the Struts con#iguration #ile. The #irst step is to add a
ne& #orm-bean element to the #orm-beans section o# the #ileD
-form+beans2
-form+bean name./loginForm/ t0pe./ 1oginForm/'2
-'form+beans2
The %alue #or the type #ield must be a #ully "uali#ied Fa%a class name that is a
descendant o# ActionForm. nce you ha%e de#ined your #orm-bean: you can
no& use it in one or more action elements. ItGs %ery common to share one
ActionForm across se%eral actions.
De)laring A)tion#orm Properties as Strings
All re"uest parameters that are sent by the bro&ser are Strings. This is true
regardless o# the type that the %alue &ill e%entually map to in Fa%a. For
example: dates: times: 5ooleans: and other %alues are all strings &hen they
are pulled out o# the re"uest. They &ill also be con%erted into strings &hen
167
they are &ritten bac6 out to the +T') page.There#ore: it ma6es sense that all
o# the ActionForm properties &here the input may be in%alid: should be o#
type String. The reason #or this is to support displaying the data bac6 out in
its original #orm to the user: &hen there is an error. For example: i# a user
types in B12[C #or a property expecting to be an Integer: thereGs no &ay to
store B12[C into an int or Integer property. +o&e%er: you can store it into a
String until it can be %alidated. This same %alue: &hich is stored in a String:
can be used to render the input #ield &ith the %alue: so the user can see their
mista6e. This is #unctionality that e%en the most inexperienced users ha%e
come to expect and loo6 #or.
Using A)tionrrors
Earlier in the chapter: you sa& that the %alidate;< method returned an
ActionErrors ob>ect. The ActionErrors class encapsulates one or more errors
that ha%e been disco%ered by the application. Each problem disco%ered is
represented by an instance o# org.apache.struts.action.ActionError. An
ActionErrors ob>ect has re"uest scope. nce an instance is created and
populated by the %alidate;< method: it is stored into the re"uest. )ater: the
FS( page can retrie%e the ob>ect #rom the re"uest and use the ActionError
ob>ects contained &ithin it to display errors messages to the user.
An instance o# ActionErrors can be instantiated in the %alidate;< method and
populated by adding instances o# the ActionError class to it.
public Action$rrors validate(ActionMapping mapping, HttpServletRequest
request3
Action$rrors errors . new Action$rrors(%
if( get$mail( .. null 44 get$mail(.lengt!( - 5 3
errors.add(/email/, new Action$rror(/securit0.error.email.required/%
6
if( get7assword( .. null 44 get7assword(.lengt!( - 5 3
errors.add(/password/,new Action$rror(/securit0.error.password.required/%
6
return errors%
168
6
The %alidate;< method in this #ragment chec6s to ma6e sure that the email
and pass&ord #ields ha%e been set &ith %alues other than an empty string. I#
not: ActionError ob>ects are added to the ActionErrors instance.
The ActionError class contains se%eral use#ul constructors.
Se%eral are listed hereD
public Action$rror(String 8e0%
public Action$rror(String 8e0, #b(ect value9%
public Action$rror(String 8e0, #b(ect value9, #b(ect value5%
public Action$rror(String 8e0, #b(ect:; values%
The 6ey argument is a String %alue that corresponds to a 6ey #rom one o# the
applicationGs resource bundles. The custom tag ErrorsTag uses this %alue to
loo6up the message to display to the user. The remaining arguments are used
as parametric replacement %alues #or the message. For example: i# you had a
bundle message de#ined li6e thisD
global.error.login.re"uired#ieldSThe \4] #ield is re"uired #or login
then &e could create an instance o# an ActionError li6e thisD
ActionError error S ne& ActionError;Rglobal.error.login.re"uired#ieldR:
BEmailC <E
The message displayed to the user a#ter substituting in the BEmailC string
&ould beD
The Email #ield is re"uired #or login
169
=hen adding instances o# the ActionError class to the ActionErrors ob>ect: the
#irst argument in the add;< method is a property that can be used to retrie%e a
speci#ic ActionError instance. I# all o# your ActionError instances can be treated
the same and you ha%e no need to retrie%e them indi%idually: you can use the
constant ActionErrors.J)5A)XERRR similar to thisD
errors.add;ActionErrors.J)5A)XERRR:
ne& ActionError;Rsecurity.error.pass&ord.re"uiredR<<E
Using Dynami) A)tion#orms
.sing the ActionForm class has many ad%antages o%er per#orming the
#unctionality yoursel# in the Action class or some set o# helper utility classes.
Since the beha%ior that the ActionForm class pro%ides is needed in nearly
e%ery &eb application: as &ell as many times in the same application: using
the #rame&or6 to per#orm the &or6 can really reduce the de%elopment time
and your #rustration le%el. +a%ing stated the bene#its o# using ActionForms:
there are a #e& %ery important do&nsides to using them.
The #irst and #oremost problem &ith using ActionForms is the sheer number o#
classes that it can add to a pro>ect. E%en i# you share ActionForm de#initions
across many pages: the additional classes ma6e it more di##icult to manage a
pro>ect and pro%ide maintenance. This is &hy some de%elopers might create a
single ActionForm and implement the properties #or all o# the +T') #orms
&ithin these. The problem &ith this o# course: is that combining the #ields into
this one class ma6es it a point o# contention on
a pro>ect that has more than >ust a #e& de%elopers. Another ma>or liability is
the re"uirement to de#ine the properties in the ActionForm that need to be
captured #rom the +T') #orm. I# a property is added or remo%ed #rom the
+T') #orm: the ActionForm class may need to be modi#ied and recompiled.
For these reasons: a ne& type o# ActionForm &as added to the #rame&or6:
&hich is dynamic in nature and allo&s you to a%oid ha%ing to create concrete
ActionForm classes #or your application. The dynamic ActionForm is
implemented by the base class org.apache.struts.action.$ynaActionForm:
&hich extends the ActionForm class.
The properties that the ActionForm de#inesD
170
1. The %alidate;< method
2. The reset;< method
The properties #or a $ynaActionForm are con#igured in the Struts
con#iguration #ile: &hich youGll see ho& to do in the next section. The reset;<
method is called at exactly the same time during re"uest processing as it is
#or a standard ActionForm. The one di##erence is that you ha%e a little less
control o%er &hat you do during the method. +o&e%er: you can al&ays
subclass the $ynaActionForm to o%erride the reset beha%ior.
The %alidation o# the presentation data is a little more complicated: because
&eGll need to &ait until &e tal6 about the Struts 9alidator components be#ore
tal6ing about ho& %alidation occurs in a dynamic #orm.
Configuring Dynami) A)tion#orm
To use the $ynaActionForm in your Struts application: the #irst step is to add
a #orm-bean element to the con#iguration #ile. There are t&o %ery important
di##erences bet&een a #orm-bean element #or a regular ActionForm and one
that is dynamic. First: a #orm-bean element #or a dynamic ActionForm is
re"uired to ha%e an attribute called dynamic: &hich must ha%e a %alue o#
BtrueC. This is necessary #or the #rame&or6 to understand that it should
handle this ActionForm di##erently. The second di##erence is that you must
include one or more #orm-property elements in order #or the dynamic #orm to
ha%e properties. The $ynaActionForm uses a >a%a.util.'ap internally to store
6ey8%alue pairs. The #orm-property elements are loaded into the 'ap and
become the properties that get populated by the #rame&or6.
N#orm-beansP
N#orm-bean nameSRloginFormR dynamicSRtrueR
typeSRorg.apache.struts.action.$ynaActionFormRP
NO-- Speci#y the dynamic properties o# the #orm --P
N#orm-property nameSRemailR typeSR>a%a.lang.String R8P
N#orm-property nameSRpass&ordR typeSR>a%a.lang.String R8P
171
NO-- Kou can also set the initial %alue o# a property --P
N#orm-property initialSC#alseC
nameSRremember'eR typeSR>a%a.lang.5oolean R8P
N8#orm-beanP
N#orm-beansP
The declarati%e properties are &hat ma6e the ActionForm dynamic. At
runtime: the #rame&or6 creates an instance o# the $ynaActionForm class and
ma6es it possible to set and get the con#igured property %alues. To add ne&
properties: you only need to modi#y the con#iguration #ile. Ho source code
needs to be changed. The po&er and #lexibility that this pro%ides #or you is
immense.
The #orm-beam element also allo&s you to speci#y the initial %alue #or each
property. The #rame&or6 &ill set the property to that %alue &hen the
application is started. The initial %alue is also used &hen the reset;< method is
called to reset the %alues bac6 to their original state. I# you donGt include the
initial attribute: then properties &ill be assigned de#ault %alues based on the
Fa%a programming languageE numbers to ?ero ;4< and properties o# type
b>ect &ill be assigned a null %alue by the #rame&or6.
Performing 4ali"ation using Dynami) A)tion#orms
Since the $ynaActionForm is used #or e%ery dynamic ActionForm and you
donGtpro%ide subclasses o# ActionForm: thereGs no &ay to o%erride the
%alidate;< method. Fortunately: the #rame&or6 comes to your aid again &ith a
#eature called the Struts 9alidator. The Struts 9alidator &as created by $a%id
=inter#eldt and is no& in the main Struts distribution. The %alidator is a
#rame&or6 that &as intended to &or6 &ith Struts #rom the beginning. It
supports basic %alidation rules li6e chec6ing #or re"uired #ields: email: date
and time #ields: and many others.
172
Struts Built/in A)tions:
The #ollo&ing are the built-in actions gi%en under the struts #rame&or6D
For&ardAction
IncludeAction
S&itchAction
$ispatchAction
#or+ar"A)tion:
The org.apache.struts.actions.For&ardAction dispatches the re"uest to the
gi%en path &ithout per#orming any action. The For&ardAction is con#igured i#
&e &ant our re"uest to be #or&arded to the gi%en path may be a FS(: Ser%let
or any other resource. The For&ardAction must be con#igured in struts-
con#ig.xml.
SyntaxD
Naction pathSB8mypathC
typeSBorg.apache.struts.actions.For&ardActionC parameterSB8'y(age.>spC8P
;R<
Naction pathSB8mypathC #or&ardSB8'y(age.>spC8P
This is the recommended approach.
In)lu"eA)tion:
The org.apache.struts.actions.IncludeAction dispatches the re"uest to the
gi%en path using the include option o# Re"uest$ispatcher. IncludeAction is
same as o# For&ardAction but this uses Re"uest$ispatcher include method to
dispatch the re"uest to the gi%en path instead o# returning ActionFor&ard to
the Re"uest(rocessor. The IncludeAction must be con#igured in struts-
con#ig.xml.
173
SyntaxD
Naction pathSB8mypathC
typeSBorg.apache.struts.actions.IncludeActionC parameterSB8'y(age.>spC8P
;R<
Naction pathSB8mypathC includeSB8'y(age.>spC8P
This is the recommended approach.
S+it)hA)tion:
The org.apache.struts.actions.S&itchAction is used to s&itch the re"uest #rom
one module to other. The S&itchAction is con#igured as a normal
actionES&itchAction accepts parameters named page and pre#ix. The page
parameter ta6es the module relati%e .RI beginning &ith B8C character to &hich
page the re"uest should be #or&arded a#ter s&itching the module.
The pre#ix parameter ta6es module name beginning &ith B8C: i.e: to &hich
module the re"uest should be s&itched.
*on#iguration in struts-con#ig.xmlD
-action pat!.&'c!angeModule)
t0pe.&org.apac!e.struts.actions.Switc!Action)prefix.&'admin)
page.&'!ome.(sp)'2
Dispat)hA)tion:
The org.apache.struts.actions.$ispatchAction class allo&s us to combine set
174
o# similar actions into a single Action class: in order to simpli#y the
application design by eliminating the need to create separate action classes
#or each o# the action. This class pro%ides a mechanism #or modulari?ing a
set o# related actions into a single Action.
The org.apache.struts.actions.$ispatchAction class is an abstract class &ith no
abstract methods and is a sub type o# 5aseAction class: &hich extends
org.apache.struts.action.Action class. The execute;< method o# $ispatchAction
dispatches the re"uest to a public method that is named by the re"uest
parameter %alue: the parameter name is speci#ied through parameter
attribute o# NactionP tag in struts-con#ig.xml #ile.
Steps to use $ispatchAction classD
*reate an action class
*on#igure action mapping
*reating action classD
Subclass the Action class &ith $ispatchAction class and pro%ides a set o#
methods that &ill be called by the execute;< method o# $ispatchAction.
Hote that this class should not o%erride execute;< method li6e other actions.
*on#iguring action mappingD
Naction pathSB8mypathC typeSBcom.m6.struts.'yActionC nameSBmy#ormC
parameterSBsubmitC %alidateSB#alseCP
N#or&ard nameSBsuccessC pathSB8home.>spC8P
175
N8actionP
)lipse ID
Eclipse is an open-source so#t&are #rame&or6 &ritten primarily in Fa%a. In its
de#ault #orm it is an Integrated $e%elopment En%ironment ;I$E< #or Fa%a
de%elopers: consisting o# the Fa%a $e%elopment Tools ;F$T< and the Eclipse
*ompiler #or Fa%a ;E*F<. .sers can extend its capabilities by installing plug-ins
&ritten #or the Eclipse so#t&are #rame&or6: such as de%elopment tool6its #or
other programming languages: and can &rite and contribute their o&n plug-in
modules. )anguage pac6s are a%ailable #or o%er a do?en languages.
Ar)hite)ture:
The basis #or Eclipse is the Rich *lient (lat#orm ;R*(<. The #ollo&ing
components constitute the rich client plat#ormD
SJi - a standard bundling #rame&or6
*ore plat#orm - boot Eclipse: run plug-ins
176
the Standard =idget Tool6it ;S=T< - a portable &idget tool6it
FFace - %ie&er classes to bring model %ie& controller programming to
S=T: #ile bu##ers: text handling: text editors
the Eclipse =or6bench - %ie&s: editors: perspecti%es: &i?ards
EclipseTs &idgets are implemented by a &idget tool6it #or Fa%a called S=T:
unli6e most Fa%a applications: &hich use the Fa%a standard Abstract =indo&
Tool6it ;A=T< or S&ing. EclipseTs user inter#ace also le%erages an intermediate
J.I layer called FFace: &hich simpli#ies the construction o# applications based
on S=T.
Eclipse employs plug-ins in order to pro%ide all o# its #unctionality on top o#
;and including< the rich client plat#orm: in contrast to some other applications
&here #unctionality is typically hard coded. This plug-in mechanism is a
light&eight so#t&are componentry #rame&or6. In addition to allo&ing Eclipse
to be extended using other programming languages such as * and (ython: the
plug-in #rame&or6 allo&s Eclipse to &or6 &ith typesetting languages li6e
)aTeI: net&or6ing applications such as telnet: and database management
systems. The plug-in architecture supports &riting any desired extension to
the en%ironment: such as #or con#iguration management. Fa%a and *9S
support is pro%ided in the Eclipse S$L.
The 6ey to the seamless integration o# tools &ith Eclipse is the plug-in. =ith
the exception o# a small run-time 6ernel: e%erything in Eclipse is a plug-in.
This means that a plug-in you de%elop integrates &ith Eclipse in exactly the
same &ay as other plug-insE in this respect: all #eatures are created e"ual.
The Eclipse S$L includes the Eclipse Fa%a $e%elopment Tools: o##ering an I$E
&ith a built-in incremental Fa%a compiler and a #ull model o# the Fa%a source
#iles. This allo&s #or ad%anced re#actoring techni"ues and code analysis. The
177
I$E also ma6es use o# a &or6space: in this case a set o# metadata o%er a #lat
#ile space allo&ing external #ile modi#ications as long as the corresponding
&or6space RresourceR is re#reshed a#ter&ards. The 9isual Editor pro>ect allo&s
inter#aces to be created interacti%ely: hence allo&ing Eclipse to be used as a
RA$ tool.
The follo+ing is a list of nota$le pro>e)ts an" plug/in for the )lipse
ID2
These pro>ects are maintained by the Eclipse community and hosted by the
Eclipse Foundation.
12 Core pro>e)ts:
Rich *lient (lat#orm ;(lat#orm< is the core #rame&or6 that all other Eclipse
pro>ects are built on.
Fa%a $e%elopment Tools ;F$T< pro%ides support #or core Fa%a SE. This
includes a standalone #ast incremental compiler.
92 Tools pro>e)ts:
*8*UU $e%elopment Tools ;*$T< adds support #or *8*UU syntax highlighting:
code #ormatting: and debugger integration and pro>ect structures. .nli6e the
F$T pro>ect: the *$T pro>ect does not add a compiler and relies on an external
tool chain.
Jraphical Editing Frame&or6 ;JEF< allo&s de%elopers to build standalone
graphical tools. Example use includes circuit diagram design tools: acti%ity
diagram editors and =KSI=KJ document editors.
72 5e$ pro>e)ts:
178
F2EE Standard Tools ;FST< extends the core F$T to include support #or Fa%a EE
pro>ects. This includes EF5s: FS(s and Ser%lets.
(+( $e%elopment Tools ;($T<
=eb Standard Tools ;=ST< adds standards compliant &eb de%elopment tools.
These tools include editors #or I'): +T') and *SS.
;2 .o"eling pro>e)ts:
Eclipse 'odeling Frame&or6 ;E'F< a modeling #rame&or6 and code
generation #acility #or building tools and other applications based on a
structured data model: #rom a model speci#ication described in I'I.
Jraphical 'odeling Frame&or6 ;J'F< is a generati%e component and runtime
in#rastructure #or de%eloping graphical editors based on E'F and JEF.
H2 Other pro>e)ts:
Test and (er#ormance Tools (lat#orm ;T(T(< &hich pro%ides a plat#orm that
allo&s so#t&are de%elopers to build test and per#ormance tools: such as
debuggers: pro#ilers and benchmar6ing applications.
5usiness Intelligence and Reporting Tools (ro>ect ;5IRT<: an Eclipse-based
open source reporting system #or &eb applications: especially those based on
Fa%a EE.
179
5e$Ser*erIAppli)ation Ser*er:
An application ser%er is a so#t&are engine that deli%ers applications to client
computers or de%ices: typically through the Internet and using the +ypertext
Trans#er (rotocol. Application ser%ers are distinguished #rom &eb ser%ers by
the extensi%e use o# ser%er-side dynamic content and #re"uent integration
&ith database engines.
Common features:
Application ser%er products typically bundle middle&are to enable applications
to intercommunicate &ith dependent applications: li6e &eb ser%ers: database
management systems: and chart programs. Some application ser%ers also
180
pro%ide an A(I: ma6ing them operating system independent. (ortals are a
common application ser%er mechanism by &hich a single point o# entry is
pro%ided to multiple de%ices.
Ga*a appli)ation ser*ers:
Ga*a Ser*ers:
Follo&ing the success o# the Fa%a plat#orm: the term application ser%er
sometimes re#ers to a Fa%a (lat#orm--Enterprise Edition ;F2EE< or Fa%a EE ,
application ser%er. Among the better 6no&n Fa%a Enterprise Edition
application ser%ers are =eb)ogic Ser%er ;5EA<: F5oss ;Red +at<: =ebSphere
;I5'<: FRun ;Adobe<: Apache Jeronimo ;Apache Foundation: based on I5'
=ebSphere<: racle *!F ;racle *orporation<: Sun Fa%a System Application
Ser%er ;Sun 'icrosystems< and Jlass#ish Application Ser%er ;based on Sun
Fa%a System Application Ser%er<.
181
Fa%a application ser%er &as the #irst open source application ser%er to ha%e
achie%ed o##icial compliance &ith the Fa%a Enterprise Speci#ication. 5EA
deli%ered the #irst Fa%a EE , certi#ied application ser%er #ollo&ed by Sun
'icrosystemsT re#erence implementation Jlass#ish.
The =eb modules are ser%lets and Fa%a Ser%er (ages: and business logic is
built into Enterprise Fa%a5eans ;EF5-3 and later<. The +ibernate pro>ect o##ers
an EF5-3 container implementation #or the F5oss Application ser%er. Tomcat
#rom Apache and FnAS #rom b>ect=eb are typical o# containers into &hich
these modules can be put.
A Fa%a Ser%er (age ;FS(< is a ser%let #rom Fa%a that executes in a =eb
containerMthe Fa%a e"ui%alent o# *JI scripts. FS(s are a &ay to create +T')
pages by embedding re#erences to the ser%er logic &ithin the page. +T')
coders and Fa%a programmers can &or6 side by side by re#erencing each
otherTs code #rom &ithin their o&n. Fa%a5eans are the independent class
components o# the Fa%a architecture #rom Sun 'icrosystems.
The application ser%ers mentioned abo%e mainly ser%e =eb applications.
Some application ser%ers target net&or6s other than the =ebD Session
Initiation (rotocol ser%ers: #or instance: target telephony net&or6s.
S)ope of The De*elopment Pro>e)t
Data$ase Tier: The concentration is applied by adopting the racle 1.1
Enterprise %ersions. SV) is ta6en as the standard "uery language. The o%erall
business rules are designed by using the po&er o# ()8SV) components li6e
stored procedures stored #unctions and database triggers.
182
User Tier: The use inter#ace is de%eloped is a bro&ser speci#ic en%ironment to
ha%e centrali?ed architecture. The components are designed using
$ream&ea%er and Fa%a ser%er pages po&er the dynamic o# the page design.
Data Base Conne)ti*ity Tier
The communication architecture is designed by concentrated on the standards
o# struts and Fa%a 5eans. The database connecti%ity is established using the
Fa%a $atabase connecti%ity.
GBOSS
F5oss Application Ser%er ;or F5oss AS< is a #ree so#t&are 8 open source Fa%a
EE-based application ser%er. 5ecause it is Fa%a-based: F5oss AS is cross-
plat#orm: usable on any operating system that Fa%a supports.
n*ironment
F5oss AS !.4 is a F2EE 1.! application ser%er: &ith embedded Tomcat ,.,. Any
F9' bet&een 1.! and 1., is supported. F5oss can run on numerous operating
systems including =indo&s: 'ac S I: many (SII plat#orms: and others: as
long as a suitable F9' is present.
F5oss AS !.2 is also a F2EE 1.! application ser%er: but EF5 3 is deployed by
de#ault. It re"uires F$L ,. Tomcat / is bundled &ith it. Hext F5oss AS , &ill be
Fa%a EE , application ser%er.
Pro"u)t features
Failo%er ;including sessions<
)oad balancing
$istributed caching ;using F5oss *ache: a standalone product<
183
$istributed deployment ;#arming<
Enterprise Fa%a5eans %ersion 3
184
Co"ing
GSP
NO$*TK(E +T') (.5)I* R-88=3*88$T$ +T') !.41 Transitional88EHRP
NhtmlP
NheadP
185
NtitlePInternet 5an6ingN8titleP
Nmeta http-e"ui%SR*ontent-TypeR contentSRtext8htmlE charsetSiso-11,3-1RP
Nlin6 hre#SR..8includes8style.cssR relSRstylesheetR typeSRtext8cssRP
N8headP
Nbody bgcolorSR44!514R le#tmarginSR4R topmarginSR4R on)oadSRgo#orit;<RP
Ntable &idthSR144YR heightSR144YR borderSR4R cellpaddingSR4R
cellspacingSR4RP
NtrP
Ntd alignSRcenterR %alignSRmiddleRPNtable &idthSR014R borderSR4R
cellspacingSR4R cellpaddingSR4RP
NtrP
Ntd heightSR01R %alignSRbottomR
bac6groundSR.8images8satya.F(JRPNtable &idthSR144YR heightSR2,R
borderSR4R cellpaddingSR4R cellspacingSR4RP
NtrP
NtdPNdi% alignSRrightRP

Nspan idSRcloc6RPN8spanP
N8di%PN8tdP
N8trP
N8tablePN8tdP
N8trP
N8tableP
186
Ntable &idthSR014R borderSR4R cellspacingSR4R cellpaddingSR4RP
NtrP
NtdPNimg srcSRimages8ibXbanner2.>pgR &idthSR014R
heightSR141RPN8tdP
N8trPNtrPNtd alignScenter &idthS1,44PN#ont
colorS&hitePN>spDinclude pageSRcustomeroptions.>spR8PN8#ontPN8tdPN8trP
N8tableP

Ntable bgcolorSR&hiteR &idthSR014R borderSR4R cellspacingSR4R
cellpaddingSR4RP
NtrP
Ntd heightSR31!R alignSRcenterRPNbrP



NcenterPNh3PN#orm actionSR.8che"ueIssueAction.doRP
Ninput typeSRtextR nameSRaccountnoR %alueSRN
YS;String<session.getAttribute;RaccountnoR< YPR8P
From number D Ninput typeSRtextR nameSR#romnumberR8P
Ninput typeSRtextR nameSRloginnameR %alueSRN
YS;String<session.getAttribute;RuserR< YPR8P
To Humber D Ninput typeSRtextR nameSRtoHumberR8P
187
Ninput typeSRtextR nameSRre"uestidR %alueSRN
YSre"uest.get(arameter;Rre"uestidR< YPR8P
Ninput typeSRsubmitR nameSRSendR %alueSR)oginR8P
N8#ormPN8h3PN8centerP

Ntable &idthSR1,YR borderSR4R alignSRcenterR cellpaddingSR2R
cellspacingSR4RP
NtrP
Ntd heightSR11R %alignSRtopRPNimg srcSR..8images8trans.gi#R
&idthSR,R heightSR,RPN8tdP
N8trP
NtrP
Ntd heightSR11R %alignSRtopRP2nbspEN8tdP
N8trP

N8tablePN8tdP
N8trP
N8tableP
N8bodyP
N8htmlP
DAO:
pac6age com.dts.S5I5an6ing.daoE
188
import com.dts.S5I5an6ing.model.5an6*he"ueRe"uestFormE
import com.dts.core.dao.Abstract$ataAccessb>ectE
import com.dts.core.util.*ore)istE
import com.dts.core.util.$ate=rapperE
import >a%a.s"l.WE
import >a%a.io.WE
public class *he"ue5oo6Re"uest extends Abstract$ataAccessb>ect \
public boolean register;5an6*he"ueRe"uestForm a#orm<
\
boolean #lagS#alseE
*onnection conSnullE
try\
int
re"uestidSgetSe"uenceI$;R*he"ue5oo6Re"uest'asterR:RRe"uestidR<E
conSget*onnection;<E
(reparedStatement pstScon.prepareStatement;Rinsert into
che"ueboo6re"uestmaster %alues;@:@:@:@:@:@:@<R<E
pst.setInt;1:re"uestid<E
pst.setString;2:$ate=rapper.parse$ate;ne&
>a%a.util.$ate;<<<E
pst.setString;3:a#orm.get)oginid;<<E
pst.setString;!:a#orm.getAccountno;<<E
pst.setString;,:a#orm.get*he"ueboo6re"uest;<<E
189
pst.setString;/:a#orm.get(re%ious*he"ue5oo6Status;<<E
pst.setString;0:RpendingR<E
int nSpst.execute.pdate;<E
i#;nP4<
\
#lagStrueE
]
]catch ;Exception e< \
e.printStac6Trace;<E
88 T$D handle exception
]
return #lagE
]
public *ore)ist %ie&*he"ueboo6re"uests;<
\
*ore)ist acorelistSne& *ore)ist;<E
5an6*he"ueRe"uestForm a#ormSnullE
*onnection conSnullE
try\
conSget*onnection;<E
(reparedStatement pstScon.prepareStatement;Rselect W
#rom *he"ue5oo6Re"uest'asterR<E
ResultSet rsSpst.executeVuery;<E
190
&hile;rs.next;<<
\
a#ormSne& 5an6*he"ueRe"uestForm;<E
a#orm.setRe"uestid;rs.getInt;1<<E
a#orm.setRe"uest$ate;$ate=rapper.parse$ate;rs.get$ate;2<<<E
a#orm.set)oginid;rs.getString;3<<E
a#orm.setAccountno;rs.getString;!<<E
a#orm.set*he"ueboo6re"uest;rs.getString;,<<E
a#orm.set(re%ious*he"ue5oo6Status;rs.getString;/<<E
a#orm.setStatus;rs.getString;0<<E
acorelist.add;a#orm<E
]
]catch ;Exception e< \
e.printStac6Trace;<E
88 T$D handle exception
]
return acorelistE
]
public boolean update*he"ueStatus;int re"uestid<
\
boolean #lagS#alseE
*onnection conSnullE
try\
conSget*onnection;<E
191
(reparedStatement pstScon.prepareStatement;Rupdate
*he"ue5oo6Re"uest'aster set StatusSTAcceptedT &here re"uestidS@R<E
pst.setInt;1:re"uestid<E
int nSpst.execute.pdate;<E
i#;nP4<
\
#lagStrueE
]
]catch ;Exception e< \
e.printStac6Trace;<E
88 T$D handle exception
]
return #lagE
]
]
192
Testi ng
193
So#t&are Testing is the process used to help identi#y the correctness:
completeness: security: and "uality o# de%eloped computer so#t&are. Testing
is a process o# technical in%estigation: per#ormed on behal# o# sta6eholders:
that is intended to re%eal "uality-related in#ormation about the product &ith
respect to the context in &hich it is intended to operate. This includes: but is
not limited to: the process o# executing a program or application &ith the
intent o# #inding errors. Vuality is not an absoluteE it is %alue to some person.
=ith that in mind: testing can ne%er completely establish the correctness o#
arbitrary computer so#t&areE testing #urnishes a criticism or comparison that
compares the state and beha%ior o# the product against a speci#ication. An
important point is that so#t&are testing should be distinguished #rom the
separate discipline o# So#t&are Vuality Assurance ;SVA<: &hich encompasses
all business process areas: not >ust testing.
There are many approaches to so#t&are testing: but e##ecti%e testing o#
complex products is essentially a process o# in%estigation: not merely a matter
o# creating and #ollo&ing routine procedure. ne de#inition o# testing is Rthe
process o# "uestioning a product in order to e%aluate itR: &here the
R"uestionsR are operations the tester attempts to execute &ith the product:
and the product ans&ers &ith its beha%ior in reaction to the probing o# the
tester^citation needed_. Although most o# the intellectual processes o# testing
are nearly identical to that o# re%ie& or inspection: the &ord testing is
connoted to mean the dynamic analysis o# the productMputting the product
through its paces. Some o# the common "uality attributes include capability:
reliability: e##iciency: portability: maintainability: compatibility and usability. A
good test is sometimes described as one &hich re%eals an errorE ho&e%er:
more recent thin6ing suggests that a good test is one &hich re%eals
in#ormation o# interest to someone &ho matters &ithin the pro>ect community.
194
Intro"u)tion:
In general: so#t&are engineers distinguish so#t&are #aults #rom so#t&are
#ailures. In case o# a #ailure: the so#t&are does not do &hat the user expects.
A #ault is a programming error that may or may not actually mani#est as a
#ailure. A #ault can also be described as an error in the correctness o# the
semantic o# a computer program. A #ault &ill become a #ailure i# the exact
computation conditions are met: one o# them being that the #aulty portion o#
computer so#t&are executes on the *(.. A #ault can also turn into a #ailure
&hen the so#t&are is ported to a di##erent hard&are plat#orm or a di##erent
compiler: or &hen the so#t&are gets extended. So#t&are testing is the
technical in%estigation o# the product under test to pro%ide sta6eholders &ith
"uality related in#ormation.
So#t&are testing may be %ie&ed as a sub-#ield o# So#t&are Vuality
Assurance but typically exists independently ;and there may be no SVA areas
in some companies<. In SVA: so#t&are process specialists and auditors ta6e a
broader %ie& on so#t&are and its de%elopment. They examine and change the
so#t&are engineering process itsel# to reduce the amount o# #aults that end up
in the code or deli%er #aster.
Regardless o# the methods used or le%el o# #ormality in%ol%ed the
desired result o# testing is a le%el o# con#idence in the so#t&are so that the
organi?ation is con#ident that the so#t&are has an acceptable de#ect rate.
=hat constitutes an acceptable de#ect rate depends on the nature o# the
so#t&are. An arcade %ideo game designed to simulate #lying an airplane &ould
presumably ha%e a much higher tolerance #or de#ects than so#t&are used to
control an actual airliner.
A problem &ith so#t&are testing is that the number o# de#ects in a
so#t&are product can be %ery large: and the number o# con#igurations o# the
product larger still. 5ugs that occur in#re"uently are di##icult to #ind in testing.
195
A rule o# thumb is that a system that is expected to #unction &ithout #aults #or
a certain length o# time must ha%e already been tested #or at least that length
o# time. This has se%ere conse"uences #or pro>ects to &rite long-li%ed reliable
so#t&are.
A common practice o# so#t&are testing is that it is per#ormed by an
independent group o# testers a#ter the #unctionality is de%eloped but be#ore it
is shipped to the customer. This practice o#ten results in the testing phase
being used as pro>ect bu##er to compensate #or pro>ect delays. Another
practice is to start so#t&are testing at the same moment the pro>ect starts and
it is a continuous process until the pro>ect #inishes.
Another common practice is #or test suites to be de%eloped during
technical support escalation procedures. Such tests are then maintained in
regression testing suites to ensure that #uture updates to the so#t&are donTt
repeat any o# the 6no&n mista6es.
It is commonly belie%ed that the earlier a de#ect is #ound the cheaper it is to
#ix it.
Time Dete)te"
Time
Introduced
Re"uirements Architecture *onstruction
System
Test
(ost-
Release
Re"uirements 1 3 ,-14 14 14-144
Architecture - 1 14 1, 2,-144
*onstruction - - 1 14 14-2,
In counterpoint: some emerging so#t&are disciplines such as extreme
programming and the agile so#t&are de%elopment mo%ement: adhere to a
Rtest-dri%en so#t&are de%elopmentR model. In this process unit tests are
196
&ritten #irst: by the programmers ;o#ten &ith pair programming in the
extreme programming methodology<. # course these tests #ail initiallyE as
they are expected to. Then as code is &ritten it passes incrementally larger
portions o# the test suites. The test suites are continuously updated as ne&
#ailure conditions and corner cases are disco%ered: and they are integrated
&ith any regression tests that are de%eloped.
.nit tests are maintained along &ith the rest o# the so#t&are source
code and generally integrated into the build process ;&ith inherently
interacti%e tests being relegated to a partially manual build acceptance
process<.
The so#t&are: tools: samples o# data input and output: and
con#igurations are all re#erred to collecti%ely as a test harness.
%istory
The separation o# debugging #rom testing &as initially introduced by
Jlen #ord F. 'yers in his 1301 boo6 the RArt o# So#t&are TestingR. Although his
attention &as on brea6age testing it illustrated the desire o# the so#t&are
engineering community to separate #undamental de%elopment acti%ities: such
as debugging: #rom that o# %eri#ication. $rs. $a%e Jelperin and =illiam *.
+et?el classi#ied in 1311 the phases and goals in so#t&are testing as #ollo&sD
until 13,/ it &as the debugging oriented period: &here testing &as o#ten
associated to debuggingD there &as no clear di##erence bet&een testing and
debugging. From 13,0-1301 there &as the demonstration oriented period
&here debugging and testing &as distinguished no& - in this period it &as
sho&n: that so#t&are satis#ies the re"uirements. The time bet&een 1303-1312
is announced as the destruction oriented period: &here the goal &as to #ind
errors. 1313-1310 is classi#ied as the e%aluation oriented periodD intention
here is that during the so#t&are li#ecycle a product e%aluation is pro%ided and
197
measuring "uality. From 1311 on it &as seen as pre%ention oriented period
&here tests &ere to demonstrate that so#t&are satis#ies its speci#ication: to
detect #aults and to pre%ent #aults. $r. Jelperin chaired the IEEE 123-1311
;Test $ocumentation Standard< &ith $r. +et?el &riting the boo6 RThe
*omplete Juide o# So#t&are TestingR. 5oth &or6s &ere pi%otal in to todayTs
testing culture and remain a consistent source o# re#erence. $r. Jelperin and
Ferry E. $urant also &ent on to de%elop +igh Impact Inspection Technology
that builds upon traditional Inspections but utili?es a test dri%en additi%e.
Testing *oncepts
Testing
Testing Methodologies
5lac6 box TestingD
=hite box Testing.
Jray 5ox Testing.
Levels of Testing
.nit Testing.
'odule Testing.
Integration Testing.
System Testing.
.ser Acceptance Testing.
198
Types Of Testing
Smo6e Testing.
Sanitary Testing.
Regression Testing.
Re-Testing.
Static Testing.
$ynamic Testing.
Alpha-Testing.
5eta-Testing.
'on6ey Testing.
*ompatibility Testing.
Installation Testing.
Adhoc Testing.
Ext7.

TCD (Test Case Documentation)
STLC
Test (lanning.
Test $e%elopment.
Test Execution.
Result Analysis.
5ug-Tracing.
Reporting.
199
Microsoft Windows Standards
Manual Testing
!utomation Testing (Tools)
=in Runner.
Test $irector.
Testing:
The process o# executing a system &ith the intent o# #inding an error.
Testing is de#ined as the process in &hich de#ects are identi#ied:
isolated: sub>ected #or recti#ication and ensured that product is de#ect
#ree in order to produce the "uality product and hence customer
satis#action.
Vuality is de#ined as >usti#ication o# the re"uirements
$e#ect is nothing but de%iation #rom the re"uirements
$e#ect is nothing but bug.
Testing --- The presence o# bugs
Testing can demonstrate the presence o# bugs: but not their absence
$ebugging and Testing are not the same thingO
Testing is a systematic attempt to brea6 a program or the A.T
$ebugging is the art or method o# unco%ering &hy the script 8program
did not execute properly.
Testing .etho"ologies:
200
Bla)k $o! TestingD is the testing process in &hich tester can per#orm
testing on an application &ithout ha%ing any internal structural
6no&ledge o# application.
.sually Test Engineers are in%ol%ed in the blac6 box testing.
5hite $o! TestingD is the testing process in &hich tester can
per#orm testing on an application &ith ha%ing internal structural
6no&ledge.
.sually The $e%elopers are in%ol%ed in &hite box testing.
0ray Bo! TestingD is the process in &hich the combination o# blac6
box and &hite box tonicsG are used.
&e*els of Testing:
201
Module" Module#
Module$
%nits %nits %nits
i8p &ntegration o8p i8p
&ntegration o'p
System Testing( )resentation * +usiness *Data+ases
%!T( user acceptance testing
ST)* ;SFT=ARE TESTIHJ )IFE *K*)E<
Test Planning:
202
12Test (lan is de#ined as a strategic document &hich
describes the procedure ho& to per#orm %arious testing on the
total application in the most e##icient &ay.
92This document in%ol%es the scope o# testing:
72 b>ecti%e o# testing:
;2 Areas that need to be tested:
H2 Areas that should not be tested:
J2 Scheduling Resource (lanning:
K2 Areas to be automated: %arious testing tools
.sed7.
Test De*elopmentD
12 Test case $e%elopment ;chec6 list<
92 Test (rocedure preparation. ;$escription o# the Test cases<.

12 Implementation o# test cases. bser%ing the result.
Result AnalysisD 12 Expected %alueD is nothing but expected beha%ior
# application.
92 Actual %alueD is nothing but actual beha%ior o#
application
Bug Tra)ing: *ollect all the #ailed cases: prepare documents.
203
Reporting: (repare document ;status o# the application<
Types Of Testing:
L Smoke TestingD is the process o# initial testing in &hich tester loo6s #or
the a%ailability o# all the #unctionality o# the application in order to per#orm
detailed testing on them. ;'ain chec6 is #or a%ailable #orms<
L Sanity Testing: is a type o# testing that is conducted on an application
initially to chec6 #or the proper beha%ior o# an application that is to chec6 all
the #unctionality are a%ailable be#ore the detailed testing is conducted by on
them.
L Regression Testing: is one o# the best and important testing.
Regression testing is the process in &hich the #unctionality: &hich is already
tested be#ore: is once again tested &hene%er some ne& change is added in
order to chec6 &hether the existing #unctionality remains same.
LRe/Testing: is the process in &hich testing is per#ormed on some
#unctionality &hich is already tested be#ore to ma6e sure that the de#ects are
204
reproducible and to rule out the en%ironments issues i# at all any de#ects are
there.
Stati) Testing: is the testing: &hich is per#ormed on an application &hen it
is not been executed.exD J.I: $ocument Testing
Dynami) Testing: is the testing &hich is per#ormed on an application &hen
it is being executed.exD Functional testing.
Alpha Testing: it is a type o# user acceptance testing: &hich is conducted
on an application &hen it is >ust be#ore released to the customer.

Beta/Testing: it is a type o# .AT that is conducted on an application &hen
it is released to the customer: &hen deployed in to the real time en%ironment
and being accessed by the real time users.
.onkey Testing: is the process in &hich abnormal operations: beyond
capacity operations are done on the application to chec6 the stability o# it in
spite o# the users abnormal beha%ior.
205
Compati$ility testing: it is the testing process in &hich usually the
products are tested on the en%ironments &ith di##erent combinations o#
databases ;application ser%ers: bro&sers7etc< In order to chec6 ho& #ar the
product is compatible &ith all these en%ironments plat#orm combination.
Installation Testing: it is the process o# testing in &hich the tester try to
install or try to deploy the module into the corresponding en%ironment by
#ollo&ing the guidelines produced in the deployment document and chec6
&hether the installation is success#ul or not.
A"ho) Testing: Adhoc Testing is the process o# testing in &hich unli6e the
#ormal testing &here in test case document is used: &ith out that test case
document testing can be done o# an application: to co%er that testing o# the
#uture &hich are not co%ered in that test case document. Also it is intended to
per#orm J.I testing &hich may in%ol%e the cosmotic issues.
TCD <Test Case Do)ument(:
Test Case Do)ument Contains
Test S)ope <or( Test o$>e)ti*e
Test S)enario
Test Pro)e"ure
Test )ase
206
This is the sample test case document #or the Acadamic details o# student
pro>ectD
Test s)ope:
Test co%erage is pro%ided #or the screen B Acadamic status entryC #orm
o# a student module o# uni%ersity management system application
Areas o# the application to be tested
Test S)enario:
=hen the o##ice personals use this screen #or the mar6s entry: calculate
the status details: sa%ing the in#ormation on studentGs basis and "uit the
#orm.
Test Pro)e"ure:
The procedure #or testing this screen is planned in such a &ay that the
data entry: status calculation #unctionality: sa%ing and "uitting
operations are tested in terms o# Jui testing: (ositi%e testing: Hegati%e
testing using the corresponding Jui test cases: (ositi%e test cases:
Hegati%e test cases respecti%ely
207
Test Cases:
Template #or Test *ase

T.*.Ho $escription Exp Act Result
0ui"elines for Test CasesD
12 0UI Test Cases:
Total no o# #eatures that need to be chec6
)oo6 2 Feel
)oo6 #or $e#ault %alues i# at all any ;date 2 Time: i# at all any re"uire<
)oo6 #or spell chec6
!ample for 0ui Test )asesD
208
T.*.Ho $escription Expected
%alue
Actual %alue Result

1
*hec6 #or all the
#eatures in the
screen
The
screen
must
contain
all the
#eatures
2
*hec6 #or the
alignment o# the
ob>ects as per the
%alidations
The
alignment
should be
in proper
&ay
92 Positi*e Test Cases:
The positi%e #lo& o# the #unctionality must be considered
9alid inputs must be used #or testing
'ust ha%e the positi%e perception to %eri#y &hether the re"uirements
are >usti#ied.
209
!ample for Positi*e Test )ases:
T.*.Ho $escription Expected
%alue
Actual %alue Result
1 *hec6 #or the date
Time Auto $isplay
The date and
time o# the
system must
be displayed
The date and
time o# the
system must
be displayed
Success
2 Enter the %alid
che"ueno into the
che"ueno #ield
It should
accept
It should
accept
Success
72 Negati*e Test Cases:
'ust ha%e negati%e perception.
In%alid inputs must be used #or test.
!ample for Negati*e Test )asesD
T.*.Ho $escription Expected
%alue
Actual %alue Result
210
1 Try to modi#y The
in#ormation in
date and time
'odi#ication
should not
be allo&
'odi#ication
should not be
allo&
#ailure
2 Enter in%alid data
in to the
5an6Ser%ice#orm:
clic6 on sa%e
It should
not accept
in%alid data:
sa%e should
not allo&
It should not
accept in%alid
data: sa%e
should not
allo&
#ailure

211
Output S)reens
212
=elcome (age
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
Reports
284
285
286
#uture nhan)ements
287
Limitations of the system(
nly the permanent employees can access the system.
System &or6s in all plat#orms and its compatible en%ironments.
Ad%anced techni"ues are not used to chec6 the authori?ation.
,uture -nhancements(
It is not possible to de%elop a system that ma6es all the re"uirements o#
the user. .ser re"uirements 6eep changing as the system is being used. Some
o# the #uture enhancements that can be done to this system areD
As the technology emerges: it is possible to upgrade the system and can
be adaptable to desired en%ironment.
5ecause it is based on ob>ect-oriented design: any #urther changes can
be easily adaptable.
5ased on the #uture security issues: security can be impro%ed using
emerging technologies.
sub admin module can be added
288
CONC&USION
289
5OR= DON:
The BInternet 5an6ing SystemC &as success#ully designed and is tested
#or accuracy and "uality. $uring this pro>ect &e ha%e accomplished all the
ob>ecti%es and this pro>ect meets the needs o# the organi?ation. The
de%eloped &ill be used in searching: retrie%ing and generating in#ormation #or
the concerned re"uests.
0OA&S
Reduced entry &or6.
Easy retrie%al o# in#ormation
Reduced errors due to human inter%ention
.ser #riendly screens to enter the data
(ortable and #lexible #or #urther enhancement
=eb enabled.
Fast #inding o# in#ormation re"uested
290

.i+liography
291
*ore Fa%a` 2 9olume I A Fundamentals 0th
Edition
*ay S. +ortsman
(earson Education A Sun 'icrosystems Jary *ornell
*ore Fa%a` 2 9olume II A Ad%anced *ay S. +ortsman
(earson Education A Sun 'icrosystems Jary *ornell
+ead First Ser%lets 2 FS( Eric Freeman
GReilly A S($ Elisabeth Freeman
The 5oo6 o# Fa%aScript 2nd Edition thau
S($
E##ecti%e Fa%a A (rogramming )anguage Juide Foshua 5loch
(earson Education A Sun 'icrosystems
Fa%a $atabase 5est (ractices Jeorge Reese
GReilly A S($
F5oss A A $e%elopers Hoteboo6 Horman Richards
GReilly A S($ Sam Jri##ith
292

You might also like