Content Management Tool-it

Published on May 2016 | Categories: Documents | Downloads: 32 | Comments: 0 | Views: 253
of 35
Download PDF   Embed   Report

Comments

Content


PROJECT REPORT
ON
CONTENT MANAGEMENT TOOL
Submitted in partial fulfillment of the requirements
for the award of the degree of
Bachelor of Technology
in
INFORMATION TECHNOLOGY
Guie!"#$ %u&'i((e &y$
M") %a*na %inha ARPIT %HARMA
B)Tech!IT#
+IT,
-
(h
Year
+
(h
%e'e"(er
A./01/0+0/1

AMITY %CHOOL OF ENGINEERING AN2
TECHNOLOGY
AC3NO4LE2GEMENT
I extend my sincere regards to the management of Amity School of Engineering and
Technology (ASET) for accepting my proposal to do summer training at AC !ireless td"
I would li#e to than# Mr) A)3 JAIN !HO2 IT# for his constant support and moti$ation"
I would li#e to put on records my sincere gratitude to the %anagement of AC !ireless
Technologies td" for gi$ing me this opportunity to do my internship in the organi&ation"
I would sincerely li#e to than# my 'aculty guide %s" Sapna Sinha and Industry guide
%r"(itesh )ohli for their unstinted support and constructi$e criticism throughout the duration
of the training"
The pro*ect would not loo# li#e it does had it not been for their interest and support"
ast but not the least+ I am extremely happy and satisfied to ha$e learned so much from the
company" The pro*ect has greatly enriched my #nowledge"
2ATE $ ./50+5.0,0 %u&'i((e By$
ARPIT %HARMA
A./01/0+0/1
+IT,
,
TOPIC
NO)
TITLE
- Introduction
, About Company
. /ro*ect and Technology used
0 Software 1equirement Specification
2 Abstract
3 'unctional 1equirements
4 5on6'unctional 1equirements
7 8ser and System 1equirements
9 :ardware 1equirements
-; Software 1equirements
-- %ilestones and Timelines
-, Interface Specifications
-. 'low <iagrams
-0 <atabases
-2 %ethodology6=$er$iew
-3 /roblem sol$ing methodology and techniques
-4 /rogram %aintenance
-7 Characteristics of a good program
-9 Stages of program de$elopment
,; ;Introduction to Eclipse I<E
,- !eb/age <esigning
,, 8se of >a$aScript
,. (alidations using >a$aScript
,0 8se of Ser$lets
,2 Accessing <atabases with ><?C Connection
,3 8se of >S/
,4 Snapshots
,7 Company /ro*ect Snapshots
,9 1esults and <iscussions
.; Conclusion
.- 1ecommendations
., 1eferences
.
AB%TRACT$
This pro*ect is aimed at de$eloping a Content %anagement System which wor#s on an
enhanced S%S6based chat ser$ice that enables a synchronous+ text6based + chatting among
mobile users" !ith S%S as the bearer it caters to the widest possible mobile user audience+
second only to $oice based solutions and ser$ices"
The pro*ect code has been written such that it achie$es e$ery single ob*ecti$e and also
allows the user to perform some functions that we thought of later""
In this pro*ect I ha$e successfully accomplished the tas# of creating a Content %anagement
Tool"
%COPE OF THE PROJECT
The pro*ect is currently being used by the organi&ation I trained for in maintaining their %6
chat ser$ice"
The ser$ice enables mobile subscribers to meet new people around common interests+ ma#e
lots of new friends and chat with them in real time without e$er ha$ing to re$eal their mobile
number"
It also pro$ides an option to subscribers to sign in to popular online I% ser$ices6access their
contacts and exchange messages with these contacts through S%S"
0
INTRO26CTION
The pro*ect gi$en to me by my industry guide %r" (itesh )ohli was that to de$elop a
Content %anagement Tool to be used in their %6chat ser$ice which in$ol$es chatting through
S%S ser$ices"

3ey7or"
Generic Technology 8ey7or"
<atabases+ /rogramming+ 5etwor# and middleware+ ?usiness logic + (alidations
+)/A@s+)1A@s
%*ecific Technology 8ey7or"
>a$aScript + >a$a Ser$er /ages +Ser$lets+ :T% + <:T%+ %icrosoft Access
<atabase
Pro9ec( (y*e 8ey7or"
Analysis+ <esign+ Implementation+ Testing+ 8ser Interface
2
Func(ional co'*onen(" of (he *ro9ec(
'ollowing is a list of functionalities of the system" %ore functionalities that you find
appropriate can be added to this list" And+ in places where the description of a functionality is
not adequate+ you can ma#e appropriate assumptions and proceed"
-" The system should ha$e appropriate login facility" 1ele$ant options li#e change password
and creating profile etc"
," The system should allow administrator to control all the acti$ities hence identify the roles
and accessibility of other users"
." There will be three types of loginA

68ser
6/ri$ileged
6Super$isory
"
%(e*" (o "(ar(:off (he *ro9ec(
-" Study and be comfortable with technologies such as >a$a Ser$er /ages + >a$aScript +
Ser$lets + /ostgres SB" Concepts of Ad$ance >a$a should be well understood" ?e familiar
with Eclipse I<E 3"2"- platform"
," 8nderstand the specification and come up with any suggestions that could be included"
." <ecide on the strategy or plan or software model to be used"
0" Create flowcharts or <'<@s"
2" Create <atabase design"
3
3" <ecide on C8I with good loo# and feel"
4" Start on creating the frontend and bac#end"
7" Co module wise in a simple step by step manner rather than rushing on all modules
together"
In the following sections of this report I aim to illustrate or explain the methodology+
requirement specification + software design document including flowcharts+ data flow
diagrams+ snapshots etc" that was central in the de$elopment of the code"
4
ABO6T THE COMPANY
AC !ireless imited is a leading de$eloper of consumer and enterprise mobile $alue added
ser$ices" A pioneer in the mobile (AS space the company has been building unique+
inno$ati$e products for o$er -; years"
AC has o$er 0; mobile operator customers in ,2 countries and ser$ices o$er -;;; enterprise
customers in India" 'ocused on the de$elopment of mobile applications o$er S%S+ I(1 and
C/1SD .C+ the company currently manages o$er 0 billion S%Ses and 0"2 billion page $iews
per annum"
AC@s products and ser$ices are spread across three #ey $erticals E %obile Communities+
Enterprise %obility and %obile Content"
AC@s flagship products include S%S Chat+ (oice Chat+ %obile Social 5etwor#ing+ ?ul#
S%S+ Short Codes+ %obile 1adio and $arious Content and Subscription Ser$ices"
'ounded in ,;;; by San*ay Coyal F (ineet >ain+ AC is a pri$ately owned company with
in$estment from 5aspers Croup and Inter6Asia (enture %anagement" The Company has ,,2
employees+ and is headquartered in <elhi (5C1) with offices in %umbai+ )ol#ata and <ubai"
The company has also been a winner of GThe 1ed :erring -;; Asia@ award and the G<eloitte
Technology 'ast 2; India@ award for three consecuti$e years"

PROJECT AN2 TECHNOLOGY
The central aim of the pro*ect is to build a content management tool which will be a small
$ersion of the one currently being deployed in AC !ireless imited@s %6chat ser$ice which
was designed and de$eloped #eeping in mind the goal of creating a healthy and clean Chat
community" :ere we try to put restriction on the users by restricting them to use words which
are considered ?adwordsD1estricted words in their nic#name" Therefore in order to stop this
we ha$e designed this content management tool"
7
%PECIFIC TECNOLOGY 3EY4OR2%A :T%+ >S/+ >A(ASC1I/T+ SE1(ETS+
FRONT:EN2 TECHNOLOGYA :T%+ >S/+ >A(ASC1I/T and SE1(ETS
:T% is used for designing of web pages"
>S/ and SE1(ETS are used for creating and implementing ?usiness ogic"
>A(ASC1I/T is used for applying $alidations at the required places"
BAC3:EN2 TECHNOLOGY$ /=STC1ES SB
TOOL% 6%E2A >,EE+ ECI/SE I<E
%OFT4ARE RE;6IREMENT %PECIFICATION!%R%#
AB%TRACT
This pro*ect is aimed at de$eloping a Content %anagement System which wor#s on an
enhanced S%S6based chat ser$ice that enables a synchronous+ text6based + chatting among
mobile users" !ith S%S as the bearer it caters to the widest possible mobile user audience+
second only to $oice based solutions and ser$ices"
F6NCTIONAL RE;6IREMENT%
'ollowing is a list of functionalities of the system" ater on as the requirements come up with
$aried use of the software more functionalities can be added easily to the pro*ect"
• Displaying of username will be login dependent, i.e., when a moderator is performing
any action on certain nickname, that nickname will not be visible to the other
moderator.
9
• The nickname command list would be for a particular time period [user can specify
this]. Default being last <4! hours.
• There will be ma*orly three types of login accounts+ one will be 8ser le$el+ second
one will be for /ri$ileged user and the third one for the Super$isory access"
• All the three accounts will ha$e different sets of control o$er the data"
The system has the following type of ogin
I" AdminD%oderator
II" Superadmin
-) The users can perform the following tas#s
Moera(or$
• "e can disapprove a nickname if found associated to badwords#restricted
words list. The name will be added to the list containing the users with
badword as their nickname, to whom $%$ notification will be sent, asking
them to change their nickname.
• "e can approve a nickname if it does not belong to &adword#'estricted word
list
NON:F6NCTIONAL RE;6IREMENT%
I" Secure access of confidential data"
II" ,0H4 a$ailability"
III" ?etter component design to get better performance at pea# time"
I(" 'lexible ser$ice based architecture will be highly desirable for future extension"
-;
6%ER AN2 THE %Y%TEM RE;6IREMENT%
Har7are re<uire'en("
Nu'&er 2e"cri*(ion Al(erna(i=e" !If a=aila&le#
- /C with , C? hard6dis#
and ,23 %? 1A%
5ot6Applicable
%of(7are re<uire'en("
Nu'&er 2e"cri*(ion Al(erna(i=e" !If a=aila&le#
- !indows 92D97DI/ with
%S6office
5ot Applicable
, %icrosoft Access 5ot Applicable
. >a$aScript 5ot Applicable
0 :T% 5ot Applicable
INTERFACE %PECIFICATION%
The "y"(e' ha" (he follo7ing in(erface"
a) ogin
-) 8ser
,) /ri$ileged
.) Super$isory
b) Control %anagement Tool window opens for different users
• Status( )ending#*pproved#Disapproved
• Time( Today#+ast , days# +ast -. days#+ast /. days.
• Moderated by( *ll#0Different users1
• 2Search by2 will only have the option to search a nickname in
all#pending#approved#disapproved category
• 'Current nickname2 will show the most recent nickname of the
user.
• 3f a nickname is marked 2*pprove2, it will be removed from the
--
pending list
• 3f a nickname is marked 2Disapprove2, it will be removed from the
pending list, and the nickname is changed for that particular
user, and the user is also informed about it.
• 4hen the 5Status6 is set to *pproved or Disapproved, a user will
be displayed
Flo7 2iagra'"
'low  CM Tool %ign:in
Flo7:%ign:in chec8"
-,
Flo7 > CM Tool!6"er#
-.
Flo7 > CM Tool!Pri=ilege 6"er#
-0
Flo7 > CM Tool !%u*er=i"ory 6"er#
-2
METHO2OLOGY: O?ER?IE4
-3
PROBLEM %OL?ING METHO2OLOGY AN2 TECHNI;6E%
/rograms are not quic# creations" In order to create an efficient and wor#ing program+ one
needs to adopt proper problem sol$ing methodology and use proper techniques"
The steps areA
-" 6N2ER%TAN2 THE PROBLEM 4ELL
To create a program+ one must be totally aware of the problem" !e must understand the
problem $ery well before attempting to design the program" Therefore a number of #ey
questions need to be answeredA
• !hat is required or desired out of the program to be designed"
• !hat is it that is to be done to attain the desired results"
.) ANALY@E THE PROBLEM
The $ery first step is to carefully analy&e the problems that the program should be able to
sol$e so that the applicable solution can be designed" Analy&ing the problems in$ol$es
identifying the program specifications and defining each program’s minimum number of
inputs required for the correct output, and the processing components.
." 2E%IGN PROCE26RE
In this step+ the solution to the problem is planned" In this step+ you are supposed to determine
the logical sequence of precise steps that sol$e that problem"
0) CO2E THE PROGRAM%
Coding is the technical word for writing the program" In this step the algorithm is translated
into a programming language" !hile translating the algorithm into the programming
language++ we identify which structures are needed to attain the desired results" Also the
appropriate arithmetic and logical operators need to be decided"
2" TE%T AN2 2EB6G THE PROGRAM%
=nce the solution6algorithm has been coded+ the next step is to testing and debugging it"
TESTI5C is the process of finding errors in a program+ and <E?8CCI5C it is the process
-4
of correcting those errors" Thorough testing is $ery important+ because once the program is
put to use+ users will rely on the program and its output+ to support acti$ities and decisions"
Thus the goal is to ensure that the program runs correctly and is error free"
3" COMPLETE THE 2OC6MENTATION
<ocumentation is intended to allow another person or programmer at any later stage to
understand the program"
Internal documentation consists of statements in the program that is not executed+ but points
out the purposes of the $arious parts of the program" <ocumentation might also consist of a
detailed description of what the program does and how to use the program" 'or commercial
purposes it may also include a user@s manual+ but that is no needed for the current pro*ect"
4" MAINTAIN PROGRAM%
%aintaining programs in$ol$es modifying the programs to remo$e pre$iously undetected
errors+ to enhance the program with different features or functionality+ or #eep the program up
to date"
THE %TEP% TO CREATE A 4OR3ING PROGRAM$
Therefore the steps to create a wor#ing program areA
-" 8nderstand the problem well"
," Analy&e the problem to
• identify minimum number of inputs required for the output
• identify processing components
." <esign the program by
• <eciding step by step solution
• ?rea#ing down solution into simpler steps
0" Code the program by
•Identifying arithmetic and logical operations required for solutions
•8sing appropriate control structures such as conditional or looping control
structure
2" Test and debug your program by
-7
• 'inding errors in it
• 1ectifying the errors
3" Complete the documentation
4" %aintain the program
A). PROGRAM MAINTENANCE
/rogram maintenance refers to the modification of a program after it has been completed+ in
order to meet changing requirements or to ta#e care of the errors that show up" There are 0
#inds of maintenanceA
-" Corrective maintenance: !hen a program after completion+ is put to operations+ some
errors might show up because of some unexpected situations+ untested areas" Such
errors are fixed up and such maintenance is called correcti$e maintenance"
2. Adaptive maintenanceA changes in the en$ironment in which a system operates may
also lead to systems maintenance" To accommodate changing needs from time to time+
maintenance is done and is called adapti$e maintenance"
3. Preventive maintenance: If possible errors are anticipated before they actually occur+
the maintenance done to a$oid them and the system don time can be decreased"
?ecause this #ind of maintenance aims at pre$enting the occurrence of errors it is
called pre$enti$e maintenance"
!. Perfective maintenance: If the existing system is maintained to #eep attuned to the
new features+ new facilities+ new capabilities+ it is said to be perfecti$e maintenance"
PROPERTIE% OF A %Y%TEM EA%Y TO MAINTAIN$
-" The systems should be planned with an eye to the future"
," 8ser specifications should be correct"
." The system should be modular"
0" <ocumentation should be complete"
2" Standards should be followed during de$elopments"
3" Testing should be thorough"
4" Attention should be paid to the end users"
-9
A)/ CHARACTERI%TIC% OF A GOO2 PROGRAM
-" Effec(i=e an efficien($ The program produces correct results and is faster+ ta#ing into
account the memory constraints"
," 6"er frienly$ The program should be user friendly" The user should not be concerned
about what is happening inside the program" The program should interact with the user by
understandable messages and user@s wor# should be as low as possible" The user should be
only responsible for pro$iding the input data $alues and e$erything else should be the
programs responsibility"
The output produced should also be easily understandable and presentable"
." %elf:ocu'en(ing coe$ A good program must ha$e self documenting code" The source
code that uses meaningful names for constant+ $ariable and subprogram identifiers to clarify
their meaning in the program+ is called a self documenting code"
0" Relia&le$ The program should be reliable i"e"+ it must be able to handle unexpected
situations li#e wrong data or no data" The program should display proper error message"
2" Por(a&le$ The program should be portable i"e"+ it should be able to run on different
platforms"
A)- %TAGE% OF PROGRAM 2E?ELOPMENT$
,) Crac8 (he *ro&le'$ In the first stage+ the problem is crac#ed and an algorithm is
formulated which gi$es the solution for the problem"
.) Coe (he "i'*le "(e*"$ In this stage the steps are translated into a program (called
the source code) using the selected programming language" This process is called
coding" The coded program is then fed into the computer for further processing"
/) Co'*ile (he *rogra'$ After feeding the program+ the next step is to compile the
program" Compilation is a process to con$ert the source code (in the programming
language) into the ob*ect code (machine language)" 'or compilation+ the appropriate
compiler is used which can translate the program written in a specific programming
language"
-) EBecu(e (he *rogra'$ After compilation+ of an error free program+ the program is
executed" This phase is called run time+ the phase of program execution during which
the program instructions are carried out"
,;
METHO2OLOGY
I was instructed by my industry guide to use ECI/SE platform" I made use of ECI/SE
I<E" Ecli*"e is a multi6language software de$elopment en$ironment comprising an
integrated de$elopment en$ironment (I<E) and an extensible plug6in system" It is written
primarily in >a$a and can be used to de$elop applications in >a$a and+ by means of $arious
plug6ins+ other languages including C+ CJJ+ C=?=+ /ython+ /erl+ /:/+ Scala and 1uby
(including 1uby on 1ails framewor#)" The I<E is often called Eclipse A<T for Ada+ Eclipse
C<T for CDCJJ+ Eclipse ><T for >a$a and Eclipse /<T for /:/" Eclipse employs plug6ins in
order to pro$ide all of its functionality on top of (and including) the runtime system+ in
contrast to some other applications where functionality is typically hard coded" The runtime
system of Eclipse is based on Equinox+ an =SCi standard compliant implementation"
This plug6in mechanism is a lightweight software component framewor#" In addition to
allowing Eclipse to be extended using other programming languages such as C and /ython+
the plug6in framewor# allows Eclipse to wor# with typesetting languages li#e aTeI+
networ#ing applications such as telnet+ and database management systems" The plug6in
architecture supports writing any desired extension to the en$ironment+ such as for
configuration management" >a$a and C(S support is pro$ided in the Eclipse S<)+ with
Sub$ersion support pro$ided by third6party plug6ins"
!ith the exception of a small run6time #ernel+ e$erything in Eclipse is a plug6in" This means
that e$ery plug6in de$eloped integrates with Eclipse in exactly the same way as other plug6
insK in this respect+ all features are Lcreated equalL" Eclipse pro$ides plug6ins for a wide
$ariety of features+ some of which are through third parties using both free and commercial
models" Examples of plug6ins include a 8% plug6in for Sequence and other 8% diagrams+
a plug6in for <? Explorer+ and many others"
The Eclipse S<) includes the Eclipse >a$a <e$elopment Tools (><T)+ offering an I<E with a
built6in incremental >a$a compiler and a full model of the >a$a source files" This allows for
ad$anced refactoring techniques and code analysis" The I<E also ma#es use of a or"space+
in this case a set of metadata o$er a flat filespace allowing external file modifications as long
as the corresponding wor#space LresourceL is refreshed afterwards"
Eclipse implements widgets through a widget tool#it for >a$a called S!T+ unli#e most >a$a
applications+ which use the >a$a standard Abstract !indow Tool#it (A!T) or Swing"
EclipseMs user interface also uses an intermediate C8I layer called >'ace+ which simplifies the
construction of applications based on S!T"
anguage pac#s pro$ide translations into o$er a do&en natural languages"
,-
An In(egra(e 2e=elo*'en( En=iron'en( !I2E# also #nown as integrated design
environment or integrated debugging environment is a software application that pro$ides
comprehensi$e facilities to computer programmers for software de$elopment" An I<E
normally consists ofA
• a source code editor
• a compiler andDor an interpreter
• build automation tools
• a debugger
ECI/SE I<E is based on >a$a , /latform+ Enterprise Edition (>,EE)+ the standard platform
used to create >a$a6based multi6tier enterprise applications" It loo#s li#e
,,
!eb /ages are designed using :T% Technology"
Progra''ing in JA?A%CRIPT
I ha=e one clien( "ie for' =alia(ion" u"ing JA?A%CRIPT
JavaScript Form Validation
>a$aScript can be used to $alidate data in :T% forms before sending off the content to a
ser$er"
'orm data that typically are chec#ed by a >a$aScript could beA
• has the user left required fields emptyN
• has the user entered a $alid e6mail addressN
• has the user entered a $alid dateN
• has the user entered text in a numeric fieldN
It is the process of chec#ing that a form has been filled in correctly before it is processed"
There are two main methods for $alidating formsA ser$er side $alidations (using CCI scripts+
AS/ etc)+ and client side (usually done using *a$ascript)"
6%E OF %ER?LET%
SE1(ETS are >a$a programs running on a web ser$er that produce results $iewed remotely
on a web ser$er" SE1(ETS has the same purpose that CCI or /:/ had in the past" I learnt
how SE1(ETS wor#s with some examples and also about Ser$let 1equest and 1esponse
%odel+ Ser$let ife Cycle+ !or#ing of ser$lets in !eblogic"
A =ery &a"ic eBa'*le illu"(ra(ing (he u"e of "er=er i"
import *a$a"io"HK
import *a$ax"ser$let"HK
import *a$ax"ser$let"http"HK
,.
public class %yser$let extends :ttpSer$let
O
public $oid doCet(:ttpSer$let1equest request+ :ttpSer$let1esponse response) throws
Ser$letException+ I=Exception
O
/rint!riter outPresponse"get!riter()K
=ut"println(Q :ello !orldR)K
S
S
Here 7e$
8se *a$ax"ser$let"H and *a$ax"ser$let"http"H
?ecause to create a ser$let+ !e must write a program that implements the
*a$ax"ser$let"Ser$let interface" %ost ser$lets implement this interface by extending either the
*a$ax"ser$let"CenericSer$let class+ which :ttpSer$let class+ which pro$ides extra
functionality needed by :TT/ ser$lets and is implemented is implemented in the
*a$ax"ser$let pac#age+ or the *a$ax"ser$let"http" in the *a$ax"ser$let"http pac#age"
And *a$a"io"H header file is used to import all the input and output parameters and functions
a$ailable in the *a$a library"
8se Lre<ue"(L to read incoming :TT/ headers (e"g" coo#ies)
DD and :T% form data (e"g" data the user entered and submitted#
8se Lre"*on"eL to specify the :TT/ response line and headers
DD (e"g" specifying the content type+ setting coo#ies)"
8se Prin(4ri(er ou( P response"get!riter()K
DD 8se LoutL to send content to browser
HTTP re<ue"( Me(ho"
8se doCet6it is the simplest most used :TT/ method"CET simply retrie$es the data
,0
identified be the 81" If the 81 refers to a script ( CCI+ ser$let+ and so on) + it returns the
data produced by the script"
8se do/ost6 li#e CET+ /=ST method is also widely used" Typically+ /=ST is used in :T%
forms" /=ST is used to transfer a bloc# of data to the ser$er in the entity body of the request"
These are the instructions we need to add for the normal functioning of any and e$ery ser$let"
5ext comes the =CIC part which deals with the condition as stated by the clients or the
requirements"
'or instance if we simply want to print a string program execution continues with the
followinf statements""
out"println(L:ello !orldL)K
the output of the abo$e ser$let program is a string :ello !orld"
THE 9a=aB)"er=le( Pac8age
INTERFACE 2E%CRIPTION
Ser$let (he 'ain in(erface (ha( all "er=le(" 'u"(
i'*le'en( ei(her irec(ly or inirec(ly)
Ser$letConfig Re*re"en(" a "er=le( configura(ion o&9ec(
fro' 7hich infor'a(ionC"uch a" (he "er=le(
na'eC ini(ial *ara'e(er"C an (he
%er=le(Con(eB( o&9ec(C can &e o&(aine)
'ilter Thi" in(erface re*re"en(" a fil(er) A fil(er
in(erce*(" a re<ue"( &efore(he re<ue"( i"
hanle an can *erfor' (a"8 on (he
re<ue"(C (he re"*on"e C or &o(h)
1equest<ispatcher 2efine" an o&9ec( (ha( i"*a(che" a re<ue"(
(o ano(her yna'ic re"ourceC "uch a" a or
a "er=le( or J%P Page)
,2
Ser$letContext The %er=le(Con(eB( o&9ec( i" (he in(erface
&e(7een (he "er=le( con(ainer an a "er=le()
One %er=le(Con(eB( o&9ec( eBi"(" for each
7e& a**lica(ion *er J?M) In "i(ua(ion"
7here (he 7hole a**lica(ion re"ie" in (he
"ane J?MC (he%er=le(Con(eB( o&9ec( can &e
u"e (o "hare glo&al infor'a(ion (ha( 7ill
&e a=aila&le (o any re"ource in (he
a**lica(ion)
Ser$letContextAttributeistener A cla"" i'*le'en(ing (hi" in(erface i" u"e
(o recei=e no(ifica(ion of change" (o (he
%er=le(Con(eB( o&9ec(D" a((ri&u(e)
Ser$letContextistener A cla"" i'*le'en(ing (hi" in(erface i"
u"e(o recei=e no(ifica(ion of change" (o
(he %erle(Con(eB( o&9ec()
Ser$let1equest Re*re"en(" a re<ue"( fro' a 7e& clien()
Ser$let1esponse Re*re"en(" a re"*on"e fro' (he "er=le( (o a
7e& clien()
SingleThread%odel Ti" in(erface i" i'*le'en(e &y a "er=le( (o
guran(ee (ha( (he "er=le( hanle" only one
re<ue"( a( a (i'e)
PICTORIAL REPRE%ENTATION OF A %ER?LET
,3
LIFE CYCLE OF A %ER?LET
The life cycle of a ser$let is controlled by the container in which the ser$let has been
deployed" !hen a request is mapped to a ser$let+ the container performs the following steps"
-" If an instance of the ser$let does not exist+ the !eb container
a" oads the ser$let class"
b" Creates an instance of the ser$let class"
c" Initiali&es the ser$let instance by calling the init method" Initiali&ation
co$ered in Initiali&ing a Ser$let"
,4
%ethod used in initiali&ation6 public $oid init (Ser$letConfig config)throws
Ser$letException
," In$o#es the ser$ice method+ passing a request and response ob*ect" Ser$ice methods
are discussed in the section !riting Ser$ice %ethods"
%ethod used6 public $oid ser$ices(Ser$let1equest req+ Ser$let1esponse res) throws
Ser$letException+ I= Exception
." If the container needs to remo$e the ser$let+ it finali&es the ser$let by calling the
ser$letMs destroy method"
<estroy method6 public $oid destroy()K
A "er=le("5 J%P a**lica(ion archi(ec(ure)
ACCE%%ING 2ATABA%E% 4ITH J2BC
,) The 9a=a)"<l *ac8age
The *a$a"sql pac#age pro$ides the A/I for accessing and processing data in a data
source" The most important members of the *a$a"sql pac#age are as followsA
• The <ri$er%anager class
• The <ri$er Interface
,7
• The Connection interface
• The Statement interface
• The 1esultSet interface
• The /reparedStatement interface
• The 1esultSet%eta<ata interface
.) Regi"(er ri=er
." Class"for5ame(Lorg"postgresql"<ri$erL)
-) E"(a&li"h Connec(ion
Connection conP<ri$er%anager"getConnection(Q*dbcAodbcAdsnR)K
1) Crea(e %(a(e'en(
Statement stPcon"createStatement()K
3" Execute a Statement
• 1esultSet rsPst"executeBuery(QR)KDD if the database is expected to send bac#
some data"
• int xPst"execute8pdate(QqueryR)KDD return int $alue+ used for insertion and
deletion"
• ?oolean yPst"execute(query)KDDreturn ?oolean
JA?A %ER?ER PAGE%
>S/ is an extremely powerful choice foe web de$elopment" >S/ is a technology using
ser$er6side scripting that is actually translated into ser$lets and compiled before they are
run" This gi$es de$elopers a scripting interface to create powerful *a$a ser$lets"
>S/ pages pro$ide tags that allow de$elopers to perform most dynamic content operations
without writing complex *a$a code" Ad$anced de$elopers can add the full power of the
*a$a programming language to perform ad$anced operations in >S/ pages"
>S/ contains following Scripting Elements"
,9
I) 2IRECTI?E%
A) Page 2irec(i=e"
B) Inclue
C) Tagli&
II" 2ECLARATION$ for declaring expressions F $ariables" TU V codeUW
III" %CRIPLET% TU Scriplet UW
TU codeUW
I?) EEPRE%%ION
TUPcode UW
TU666666666666for comments in >S/W
I'E CXCE =' >S/
-) Translate >S/ to Ser$let code"
,) Compile ser$let to byte code"
.) oad the se$er class"
0) Create ser$let instance"
2) Call the *spInit method"
3) Call the *spSer$ice method"
PAGE 2IRECTI?E
*a$ap *a$ax"ser$let"http":ttp>sp/ageDDthis pac#age is used to import all the methods and
parameters included in ser$lets"
TU Y importPR*a$a"util"HRUWDDthis page directi$e is used to import the utilities of *a$a"util
pac#age li#e date etc"
TU V String namePR*sp"pageRK
public int sum(int a+ int b)
O
return(aJb)K
S
UW
/rogram to get sum of , numbers using scriplet code in >S/
TU int aPsum(4+7)K
.;
out"println(Qsum is APJaR)K
out"println(Qstring passedAPPRJname)K
UW
TbrW
Today dateAPP
TU Pnew <ate() UW
/rogram to print today@s date using date() function in the util pac#age"
>S/ I%/ICIT =?>ECTS
-) 1equest
TU66666666666666
String xPrequest"get/arameter(GoneR)K
Int aPInteger"parseInt(x)K
666666666666666666 UW
This ob*ect is used when we want to get parameters say x or y"
,) 1esponse
TU6666666
response"send1edirect(QurlR)K
666666UWTDbodyW
This ob*ect will open the page gi$en in the 81"
.) =ut
it is used to describe data being sent to the output stream in response to a client
request" the output stream is exposed to the *sp author through the implicit out ob*ect"
The out ob*ect is an instantiation of a *a$ax"ser$let"*sp">sp!riter ob*ect"
0) /ageContext
TU6666666666666666666
>S/!riter xy&PpageContext"get=ut()K
xy&"println(Qxy&R)K
66666666666666666666666UW
TDbodyW
It is an implicit ob*ect used in try6catch bloc# to get the output printed+ if it is not used
then number format exception will occur"
.-
2) /age
TU V int yP9;KDDdeclaration
UW
TU int yP9;;KDDscriplet
out"println(y)K
out"println(this"y)K
UW
TbodyW
it is used for declaration of $ariables and coding part of a >S/ page"
TU Y page languagePR*a$aRKUW
out"println (Q>S/ is easyR)K
UW
>S/ container defines language to be used by default as *a$a"
3) Session ob*ect
4) Config ob*ect
7) Exception ob*ect
9) Application ob*ect
S=%E ATT1I?8TES
Info
TU Y page languagePR*a$aRK UW
TU out"println(Q*sp is easyR)K UW
TU Y page infoPRwritten by any R UW
TU out"println(getSer$letInfo())K UW
!hen used with expression tag it will be written as
TU PgetSer$letInfo() UW
!hate$er is declared inside it+ it is retrie$ed using
getSer$letInfo()
Import
TU Y importPR*a$a"io"HR UW
TU Y importPR*a$a"util"CalendarR UW
The abo$e page directi$e imports the *a$a"utilCalendar class"
.,
The buffer and auto'lush attributes
The buffer attribute determines whether the >S/ page will be buffered+ and the buffer
si&e if it is to be buffered"
The auto'lush attribute determines the page@s beha$iour when the page buffer is full
or exceeded"
The error/age and is Error/age attributes
The error/age attribute specifies a url for forwarding exceptions"
The >S/ page sent an exception by means of an error/age attribute must ha$e the page
attribute of is Error/age set to be QtrueR" ?y default it is set to QfalseR" If QtrueR an
explicit scripting $ariable called exception is created and referenced to the Throwable
error ob*ect from the source >S/ ob*ect"
The is ThreadSafe attribute
It specifies the thread safety of the >S/ page" ?y default it is true" !hen false the page
must deal with synchroni&ation issues"
The session attribute
It is true by default"
*a$ax"ser$let"http":ttpSession is declared"
Session attribute must be made as false when it is not a part of the page+ it
unnecessarily consumes the resources"
..
INCL62E 2IRECTI?E
TU Y include filePRfirst"htmlR UW
TU out"println(Qin >S/ pageR)K
UW
TU Y include filePRsecond"htmlR UW
This directi$e allows data from an external 81 to be inserted into the current >S/ page"
The data is included in the current >S/ page before it is compiled because the include
directi$e inserts the data from the external 81 at the translation time"
TAGLIB 2IRECTI?E
It specifies a tag library by which the standard set of >S/ tags can be extended"
%TAN2AR2 ACTION ELEMENT%
,# Inclue ac(ion
The include action inserts the data from the external 81 at the request time in
contrast to the include directi$e"
T *sp6includeZZ""W
It cannot affect other parts of the page"
.# The Ja=aBean ac(ion"
T*sp6use?eanW attributes
id+ scope+ class+ type+ bean5ame
T*sp6setpropertyW attributes
name+ property+ param+ $alue
T*sp6getpropertyWattributes
name+ property
.0
RE%6LT% AN2 2I%C6%%ION%$
The pro*ect was successfully completed+ the Tool is wor#ing properly with all the
functionalities running smoothly and with complete efficiency"
CONCL6%ION%$
It functions correctly on any system that meet the requirements gi$en in the S1S"
The pro*ect is compatible with the processor pro$ided in the S1S"
RECOMMEN2ATION%
!e can also use some designing software for the designing part"
REFERENCE%
Boo8"$
Co'*le(e reference &y Her&er( %hiel
Boo8" on 7e& e"igning CHTML e(c)
4e&"i(e"$
777)google)co'
777)7/"chool")co'
777)one"(o*(e"(ing )co'
777)ro"einia)ne(
.2

Sponsor Documents

Or use your account on DocShare.tips

Hide

Forgot your password?

Or register your new account on DocShare.tips

Hide

Lost your password? Please enter your email address. You will receive a link to create a new password.

Back to log-in

Close