0% found this document useful (0 votes)
69 views27 pages

Project Report: Utility Web App For Lovely Students

This project report summarizes the development of a utility web app for Lovely Students. The app aims to provide various facilities for students like a bunk and CA calculator, faculty information, chat forums, upcoming events, location finder and budget management. It is being developed under the guidance of Miss Maneet Kaur at Lovely Professional University using Dreamweaver and Netbeans. The report outlines the existing system limitations, proposed additions, product definition, software requirements and modular design including entity relationship and data flow diagrams.

Uploaded by

Arshiya Sethi
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOC, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
69 views27 pages

Project Report: Utility Web App For Lovely Students

This project report summarizes the development of a utility web app for Lovely Students. The app aims to provide various facilities for students like a bunk and CA calculator, faculty information, chat forums, upcoming events, location finder and budget management. It is being developed under the guidance of Miss Maneet Kaur at Lovely Professional University using Dreamweaver and Netbeans. The report outlines the existing system limitations, proposed additions, product definition, software requirements and modular design including entity relationship and data flow diagrams.

Uploaded by

Arshiya Sethi
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOC, PDF, TXT or read online on Scribd
You are on page 1/ 27

PROJECT REPORT

UTILITY WEB APP FOR LOVELY STUDENTS Submitted by Sonia Sharma Registration Number:-11002447 Rubal Registration Number:-11000393 Jasdeep Rana Registration Number:-11003142

nder the !uidan"e o# MISS MANEET KAUR

Department of CSE Lo e!" S#$oo! % In&t't(te of S#'en#e an) Te#$no!o*" Lo e!" Profe&&'ona! Un' er&'t"+ P$a*,ara

ACKNOWLED-EMENT !ratitude "annot be seen or e$pressed% &t "an only be #elt in heart and is beyond des"ription% '#ten (ords are inade)uate to ser*e as a model o# e$pression o# one+s #eeling, spe"ially the sense o# indebtedness and gratitude to all those (ho help us in our duty% &t is o# immense pleasure and pro#ound pri*ilege to e$press my gratitude and indebtedness along (ith sin"ere than-s to M'&& Maneet Ka(r #or pro*iding us the opportunity to (or- #or a pro.e"t on /Ut'!'t" We. app for !o e!" &t()ent&0% 1uring the entire training session, (e ha*e re"ei*ed endless help #rom her% & (ant to #ormally a"-no(ledge my sin"erest gratitude to all those (ho assisted and guided me in "ompleting this pro.e"t report and ma-ing my summer training a memorable and su""ess#ul e$perien"e% & am beholden to my #amily and #riends #or their blessings and en"ouragement%

Sonia Sharma Rubal Jasdeep Rana

INTRODUCTION

2n utility (eb app #or lo*ely students is the in#ormational app pro*ides *arious #a"ilities #or students that are not a*ailable in the "urrent running system #or e$ample:
1%

B(n/ an) CA #a!#(!ator : &n this module students "an see ho( many
le"tures they "an s-ip in one semester so that they "an gi*e #inal e$ams (ithout any penalty% 3arious rules related to e$aminations (ill be there on the sites addition to bun- "al"ulator another 'mportant #omponent '& #(m(!at' e a&&e&&ment 0CA1+in (hi"h one "an see the per#orman"e o# #irst t(o tests on the basis o# (hi"h he or she "an de"ide (hether to s-ip the third test or not%

2%

Fa#(!t" 'nfo: &n this module student "an "he"- the #ree time slot #or the related
#a"ulty that (here is he or she no( so that student "an meet them and sol*e there )ueries% 4ime table o# #a"ulty (ill be sho(n to student%

3%

C$at porta!% for(m: 4his module pro*ide a #a"ility to intera"t (ith other
students so that students "an share in#ormation related to studies #or e$ample one "an in#orm his "lassmates about any -ind o# test or any other important in#ormation% Similary to "hat portal (e ha*e another module named personal a"ti*ity in this #orum students "an see his o(n a"ti*ity li-e his "omments only and has re"ord o# personal "omments (hat he did in *arious posts%

4%

2appen'n* e ent&3 This module (ill tell about the e*ents related to interests o#
students and also pro*ide timing and lo"ations (here the e*ents are going on% 5or e$ample i# someone puts his interest in musi" then all musi" related e*ents (ill sho(n to him (ith the "onta"t numbers o# the #a"ulty and room numbers ( here the preparatory "lasses are going on%

6%

Lo#at'on f'n)er an) .()*et mana*ement : 4his module (ill help students
#or #inding stationary things and lo"ations (here they "an easily get their re)uired things in addition to this budget management is also there that manage the budget o# the student a""ording the money he or she ha*e% 5or e$ample i# one is ha*ing Rs%200 #or one (ee- then he "an drinh one banana sha-e e*ery day (ith other things%

E4'&t'n* &"&tem3

1%4he e$isting system does not pro*ide any "al"ulator #or analysing le"tures and 72 "omponents that is students are unable to de"ide or "al"ulate ho( many le"tures they ha*e to attend so that they (ill not get detained%

2%5a"ulty in#ormation (as not there in the e$isting system so students ha*e to sear"h #or #a"ulty in di##erents di##erent "abin at di##erent timings%

3%Ear!'er no 'nformat'on ,a& pro ')e) re!ate) to t$e e ent& $appen'n* a##or)'n* to 'ntere&t of t$e &t()ent%

4%&n the e$isting system "hat 8portal #orum (as not there %Students "annot share in#ormation (ith ea"h other related to studies online%

ADDITION TO T2E CURRENT SYSTEM


'ur utlity (eb app #or lo*ely students redu"e the e##ort o# "al"ulating attendant or bun-ed le"tures on paper%9e "an easily and #astly "al"ulate our "umulati*e assessment ,it sa*es the time o# student% 'ur system redu"e the student e##orts and sa*e timings so that they "an utili:e it in proper manner, no more roaming (ill be there #or sear"h o# any #a"ulty%

'ur system pro*ide in#ormation easily (ithout any hassle o# going to di##erent blo"and sear"hing #or #a"ulty related to the parti"ular e*ent%

'ur utility (eb app pro*ide the #eature o# "hat8portal #orum% 4his module pro*ide a #a"ility to intera"t (ith other students so that students "an share in#ormation related to studies #or e$ample one "an in#orm his "lassmates about any -ind o# test or any other important in#ormation% Similary to "hat portal (e ha*e another module named personal a"ti*ity in this #orum students "an see his o(n a"ti*ity li-e his "omments only and has re"ord o# personal "omments (hat he did in *arious posts%

PRODUCT DEFINITION

4his is a (eb portal or an online appli"ation "arrying the #eatures li-e "al"ulating bun-s and 72 "omponentsand budget o# student , along (ith #a"ulty in#ormation %7hat portal is there (here student "an "ommuni"ate (ith other students,they "an share in#ormation (ith ea"h other related to studies #or e$ample one "an in#orm his "lassmates about any -ind o# test or any other important in#ormation% 9ith a broader *ie( o# pro*iding best -no(ledge about (here the interested e*ent is happenging along (ith the timing and lo"ation % 2s the in*ol*ement o# te"hnology in a parti"ular #ield ma-es the system more user #riendly%

SOFTWARE RE5UIREMENTS36 1% 1ream(ea*er 2% Netbeans

1ream(ea*er:- Dream,ea

er is a proprietary (eb de*elopment tool de*eloped by 2dobe Systems% 1ream(ea*er (as originally de*eloped by ;a"romedia in 1997, and (as maintained by them until ;a"romedia (as a")uired by 2dobe Systems in 2006%

2dobe 1ream(ea*er is a (eb design and de*elopment appli"ation that pro*ides a *isual editor and a "ode editor (ith standard #eatures su"h as synta$ highlighting, "ode "ompletion, and "ode "ollapsing as (ell as more sophisti"ated #eatures su"h as real-time synta$ "he"-ing and "ode introspe"tion #or generating "ode hints to assist the user in (riting "ode% 4he 1esign *ie( #a"ilitates rapid layout design and "ode generation as it allo(s users to )ui"-ly "reate and manipulate the layout o# <4;= elements% 1ream(ea*er #eatures an integrated bro(ser #or pre*ie(ing de*eloped (ebpages in the program>s o(n pre*ie( pane in addition to allo(ing "ontent to be open in lo"ally installed web browsers.

N?4@?2NS:-

NetBean& is an integrated de*elopment en*ironment A&1?B #or de*eloping primarily (ith Ja*a, but also (ith other languages, in parti"ular C<C, 787DD, and <4;=6%E &t is also an appli"ation plat#orm #rame(or- #or Ja*a des-top appli"ations and others% 4he Net@eans &1? is (ritten in Ja*a and "an run on 9indo(s, 'S F, =inu$, Solaris and other plat#orms supporting a "ompatible J3;% 4he Net@eans Clat#orm allo(s appli"ations to be de*eloped #rom a set o# modular so#t(are "omponents "alled modules% 2ppli"ations based on the Net@eans Clat#orm Ain"luding the Net@eans &1? itsel#B "an be e$tended by third party de*elopers% 4he Net@eans 4eam a"ti*ely support the produ"t and see- #eature suggestions #rom the (ider "ommunity% ?*ery release is pre"eded by a time #or 7ommunity testing and #eedba"-%

MODULAR DESI-N3

2 so#t(are system is al(ays di*ided into se*eral sub systems that ma-es it easier #or the de*elopment% 2 so#t(are system that is stru"tured into se*eral subsystems ma-es it easy #or the de*elopment and testing% 4he di##erent subsystems are -no(n as the modules and the pro"ess o# di*iding an entire system into subsystems is -no(n as modulari:ation or de"omposition% A &"&tem #annot .e )e#ompo&e) 'nto &e era! &(.&"&tem& 'n an" ,a"7 T$ere m(&t &ome !o*'#a! .arr'er+ ,$'#$ fa#'!'tate& t$e &eparat'on of ea#$ mo)(!e7 T$e &eparat'on m(&t .e &'mp!e .(t "et m(&t .e effe#t' e &o t$at t$e )e e!opment '& not affe#te)7

&n order to identi#y *arious entities and relationship set ,entity set ,attributers, lin- attributes 4he 1iagram o# this pro"ess as under%4he symbol o# used are sho(n belo( =&N?
RELATIONS HIP SET OVAL

ENTITY SET

F!o, #$art

START

LOGIN

IF REGISTE RED

N'

REGISTERATI ON

G?S

HOME

BUNK CALCULAT OR

CA CACULATO R

FACULTY INFO 3

EVENTS

PLAN BUDGET

Lo!"&'"$ Lo!"&'"$ PASS(O PASS(O RD RD Re!"s#ere$ %ser S#%'"$ S#%'"$ %ses %ses "$"$ C.,# )or%/ se0#"o& se0#"o&

S#%'&,/e S#%'&,/e &,/e &,/e Ver") Ver") **

U#"+"#* ,-- .o/e -,!e

,00es ,00es ss

S#%$e&#

B%&1 S#%$e&#'"$ S#%$e&#'"$ ,##e&$e&0 ,##e&$e&0 ee

0,+0%+,# 0,+0%+,# ee

CA

C.e0 C.e0 11

Ter/ Ter/ -,-er -,-er

Tes# Tes#

E2e&#s F,0%+#* "&)o Lo0,#"o& Lo0,#"o& T"/"&! T"/"&! F,0%+#*'" F,0%+#*'" $$ F,0%+#*'&,/e F,0%+#*'&,/e B+o01'&o B+o01'&o T"/e'#,b+e T"/e'#,b+e

C,b"&'& C,b"&'& oo

DATA FLOW DIA-RAMS


1ata #lo( diagram is a geographi"al tool that sho(s, pro"ess, #lo(s, stores and e$ternal entities in a system% 1ata#lo( diagram sho(s the trans#ormation o# data into a system% 1#d has got the #ollo(ing symbols

CONTE8T LEVEL DIA-RAM

Le e! 9 DFD

U&e #a&e )'a*ram3


4he purpose o# use "ase diagram is to "apture the dynami" aspe"t o# a system% @ut this de#inition is too generi" to des"ribe the purpose% se "ase diagrams are "onsidered #or high le*el re)uirement analysis o# a system% So (hen the re)uirements o# a system are analy:ed the #un"tionalities are "aptured in use "ases% So (e "an say that uses "ases are nothing but the system #un"tionalities (ritten in an organi:ed manner% No( the se"ond things (hi"h are rele*ant to the use "ases are the a"tors% 2"tors "an be de#ined as something that intera"ts (ith the system%

4he a"tors "an be human user, some internal appli"ations or may be some e$ternal appli"ations% So in a brie# (hen (e are planning to dra( an use "ase diagram (e should ha*e the #ollo(ing items identi#ied%

5un"tionalities to be represented as an use "ase 2"tors Relationships among the use "ases and a"tors%

&n our system a"tors are administrator and students (hi"h use the #un"tionalities o# the use "ase and relationships are there bet(een a"tors and use "ase%

5ig: se "ase diagram o# utility (eb appli"ation #or lo*ely students

C!a&& )'a*ram&3
4he "lass diagram is a stati" diagram% &t represents the stati" *ie( o# an appli"ation% 7lass diagram is not only used #or *isuali:ing, des"ribing and do"umenting di##erent aspe"ts o# a system but also #or "onstru"ting e$e"utable "ode o# the so#t(are appli"ation%

4he "lass diagram des"ribes the attributes and operations o# a "lass and also the "onstraints imposed on the system% 4he "lass diagrams are (idely used in the modelling o# ob.e"t oriented systems be"ause they are the only ;= diagrams (hi"h "an be mapped dire"tly (ith ob.e"t oriented languages% 4he "lass diagram sho(s a "olle"tion o# "lasses, inter#a"es, asso"iations, "ollaborations and "onstraints% &t is also -no(n as a structural diagram%

P(rpo&e3
4he purpose o# the "lass diagram is to model the stati" *ie( o# an appli"ation% 4he "lass diagrams are the only diagrams (hi"h "an be dire"tly mapped (ith ob.e"t oriented languages and thus (idely used at the time o# "onstru"tion% 4he ;= diagrams li-e a"ti*ity diagram, se)uen"e diagram "an only gi*e the se)uen"e #lo( o# the appli"ation but "lass diagram is a bit di##erent% So it is the most popular ;= diagram in the "oder "ommunity% So the purpose o# the "lass diagram "an be summari:ed as:

2nalysis and design o# the stati" *ie( o# an appli"ation% 1es"ribe responsibilities o# a system% @ase #or "omponent and deployment diagrams% 5or(ard and re*erse engineering%

TEC2NI5UES OF SOFTWARE TESTIN:79 UNIT TESTIN nit 4esting is primarily "arried out by the de*elopers themsel*es% 1eals #un"tional "orre"tness and the "ompleteness o# indi*idual program units% 9hite bo$ testing methods are employed

:7; INTE-RATION TESTIN &ntegration 4esting: 1eals (ith testing (hen se*eral program units are integrated% Regression testing : 7hange o# beha*ior due to modi#i"ation or addition is "alled RegressionH% sed to bring "hanges #rom (orst to least% &n"remental &ntegration 4esting : 7he"-s out #or bugs (hi"h en"ounter (hen a module has been integrated to the e$isting%

:7< SYSTEM TESTIN System 4esting - 1eals (ith testing the (hole program system #or its intended purpose%

Re"o*ery 4esting: System is #or"ed to #ail and is "he"-ed out ho( (ell the system re"o*ers the #ailure% Se"urity 4esting: 7he"-s the "apability o# system to de#end itsel# #rom hostile atta"- on programs and data% =oad I Stress 4esting: 4he system is tested #or ma$ load and e$treme stress points are #igured out%

:7= BLACK6BO8 TEST DESI-N &t treats the system as a Jbla"--bo$J, so it doesn>t e$pli"itly use -no(ledge o# the internal stru"ture% @la"--bo$ test design is usually des"ribed as #o"using on testing #un"tional re)uirements% 4he resear"h in bla"--bo$ testing mainly #o"uses on ho( to ma$imi:e the e##e"ti*eness o# testing (ith minimum "ost :7> W2ITE6BO8 TEST DESI-N &t allo(s one to pee- inside the Jbo$0, and it #o"uses spe"i#i"ally on using internal -no(ledge o# the so#t(are to guide the sele"tion o# test data% 4esting plans are made a""ording to the details o# the so#t(are implementation, su"h as programming language, logi", and styles% 4est "ases are deri*ed #rom the program stru"ture% 9hite-bo$ testing is also "alled glass-bo$ testing, logi"-dri*en testing%

SOURCE CODE

Ent't" 3 St()ent
pa"-age entityK import .a*a%io%Seriali:ableK import .a*a$%persisten"e%?ntityK import .a*a$%persisten"e%!enerated3alueK import .a*a$%persisten"e%!eneration4ypeK import .a*a$%persisten"e%&dK

L?ntity publi" "lass Student implements Seriali:able M pri*ate stati" #inal long serial3ersion &1 N 1=K L&d L!enerated3alueAstrategy N !eneration4ype%2 4'B pri*ate long RegidK pri*ate String pass(ordK pri*ate String emailK pri*ate String hintOuestionK pri*ate String hint2ns(erK pri*ate String #ullNameK pri*ate long mobileNoK pri*ate String bat"hK pri*ate String programmeK pri*ate String i1K pri*ate String i2K pri*ate String i3K publi" long getReg&dAB M return RegidK P publi" *oid setReg&dAlong idB M this%Regid N idK P

publi" String getCass(ordAB M return pass(ordK P publi" *oid setCass(ordAString pass(ordB M this%pass(ord N pass(ordK

P publi" String get?mailAB M return emailK P publi" *oid set?mailAString emailB M this%email N emailK P publi" String get<intOuestionAB M return hintOuestionK P publi" *oid set<intOuestionAString hintOuestionB M this%hintOuestion N hintOuestionK P publi" String get<int2ns(erAB M return hint2ns(erK P publi" *oid set<int2ns(erAString hint2ns(erB M this%hint2ns(er N hint2ns(erK P publi" String get5ullNameAB M return #ullNameK P publi" *oid set5ullNameAString #ullNameB M this%#ullName N #ullNameK P publi" long get;obileNoAB M return mobileNoK P publi" *oid set;obileNoAlong mobileNoB M

this%mobileNo N mobileNoK P publi" String get@at"hAB M return bat"hK P

publi" *oid set@at"hAString bat"hB M this%bat"h N bat"hK P publi" String getCrogrammeAB M return programmeK P publi" *oid setCrogrammeAString programmeB M this%programme N programmeK P

publi" String get&1AB M return i1K P publi" *oid set&1AString i1B M this%i1 N i1K P publi" String get&2AB M return i2K P publi" *oid set&2AString i2B M this%i2 N i2K P publi" String get&3AB M

return i3K P publi" *oid set&3AString i3B M this%i3 N i3K P P

Ja a Ser er Pa*e 3 2ome Pa*e


QRLpage "ontent4ypeNJte$t8htmlJ page?n"odingNJ 45-SJRT QU1'74GC? htmlT Qhtml QheadT QtitleT<ome CageQ8titleT Qmeta "harsetNJut#-SJT Qlin- relNJstylesheetJ hre#NJ"ss8reset%"ssJ typeNJte$t8"ssJ mediaNJallJT Qlin- relNJstylesheetJ hre#NJ"ss8style%"ssJ typeNJte$t8"ssJ mediaNJallJT Qs"ript typeNJte$t8.a*as"riptJ sr"NJ.a*as"ript8.)uery-1%4%2%min%.sJ TQ8s"riptT Qs"ript typeNJte$t8.a*as"riptJ sr"NJ.a*as"ript8"u#on-yui%.sJTQ8s"riptT Qs"ript typeNJte$t8.a*as"riptJ sr"NJ.a*as"ript8"u#on-repla"e%.sJTQ8s"riptT Qs"ript typeNJte$t8.a*as"riptJ sr"NJ.a*as"ript8;yriadHCroH300%#ont%.sJTQ8s"riptT Qs"ript typeNJte$t8.a*as"riptJ sr"NJ.a*as"ript8;yriadHCroH400%#ont%.sJTQ8s"riptT Qs"ript typeNJte$t8.a*as"riptJ sr"NJ.a*as"ript8s"ript%.sJTQ8s"riptT Qs"ript typeNJte$t8.a*as"riptJ sr"NJ.a*as"ript8.a*as"ript%.sJ TQ8s"riptT Q8headT

QbodyT QU-- S42R4 C2!? S' R7? --T

Qdi* "lassNJ(rapJT QheaderT Qdi* "lassNJ"ontainerJT Qh1TQa hre#NJVJT tility 9eb 2pp #or =o*ely StudentsQ8aTQ8h1T Qna*T QulT QliTQa hre#NJhome%.spJ "lassNJm1JT<omeQ8aTQ8liT QliTQa hre#NJVJ "lassNJm2JT5orumQ8aTQ8liT QliTQa hre#NJVJ "lassNJm3JT?*entsQ8aTQ8liT QliTQa hre#NJVJ "lassNJm4JTCre#eren"esQ8aTQ8liT Qli "lassNJlastJTQa hre#NJVJ "lassNJm6JT=og'utQ8aTQ8liT Q8ulT Q8na*T Q#orm a"tionNJVJ idNJsear"h-#ormJT Q#ieldsetT Qdi* "lassNJro(?lemJT Qinput typeNJte$tJTQa hre#NJVJTSear"hQ8aT Q8di*T Q8#ieldsetT Q8#ormT Q8di*T Q8headerT Qdi* "lassNJ"ontainerJT QasideT Qh3TNa*igationQ8h3T Qul "lassNJ"ategoriesJT QliTQspanTQa hre#NJhome%.spJT<omeQ8aTQ8spanTQ8liT QliTQspanTQa hre#NJ"al"ulatebun-%.spJT7alu"late @un-Q8aTQ8spanTQ8liT QliTQspanTQa hre#NJ"ommulati*eassesment%.spJT7alu"late 72Q8aTQ8spanTQ8liT

QliTQspanTQa hre#NJ"al"ulategrade%.spJT7alu"late !radeQ8aTQ8spanTQ8liT QliTQspanTQa hre#NJ#indstationaryitem%.spJT5ind Stationary &temQ8aTQ8spanTQ8liT QliTQspanTQa hre#NJ#ind#ooditem%.spJT5ind 5ood &temQ8aTQ8spanTQ8liT Qli "lassNJlastJTQspanTQa hre#NJ#ind#a"ulty%.spJT5ind 5a"ultyQ8aTQ8spanTQ8liT Q8ulT Qh2T p"oming QspanT?*entsQ8spanTQ8h2T Qul "lassNJne(sJT QliTQstrongT;ar"h 20, 2014Q8strongTQh4TQa hre#NJVJT7on"o 4e"hQ8aTQ8h4T Ceople (ho are "ra:y enough to thin- they "an "hange the (orld %%% 2re the ones (ho doUU 4he (ait is o*er%%% So (hat are you (aiting #or te"hno"rats%%%"ome and sho( (hat u "an do%%% U Q8liT QliTQstrongT;ar"h 14, 2014Q8strongTQh4TQa hre#NJVJT'ne 9orldQ8aTQ8h4T ts is our great pleasure to in#orm you that the =o*ely Cro#essional ni*ersity is hosting the South 2sian ni*ersities 5esti*alASau#estB #rom 11th to 16th ;ar"h%2014% 4he theme o# the S2 5?S4 is !lobal pea"e, 1e*elopment and harmony% Q8liT QliTQstrongT;ay 1S, 2014Q8strongTQh4TQa hre#NJVJTR?N2&SS2N7?+14 Q8aTQ8h4T Student Cro.e"t 7ell under the aegis o# 1i*ision o# Student 2##airs is planning to send a "ontingent to R?N2&SS2N7?+14 at J?7R7, J2&C R #rom 12th-16th ;ar"h 2014% Q8liT Q8ulT Q8asideT Qse"tion idNJ"ontentJT Qdi* "lassNJdetailbo$JT Qdi* "lassNJle#tJT Qimg sr"NJ%%8images8dp%.pgJ altNJCro#ile Ci" hereJT Q8di*T Qdi* "lassNJrightJT QtableT QtrT QtdTStudent Reg NoQ8tdT Q8trT QtrT

QtdTStudent NameQ8tdT Q8trT QtrT QtdT"lassQ8tdT Q8trT QtrT QtdT@at"hQ8tdT Q8trT Q8tableT Q8di*T Q8di*T Qdi* "lassNJinsideJT QpTQ8pT Q8di*T Q8se"tionT Q8di*T Q8di*T Q8bodyT Q8htmlT

Ser !et 3 Ca!#(!ate B(n/

import .a*a%io%&'?$"eptionK import .a*a%io%Crint9riterK import .a*a%te$t%Simple1ate5ormatK import .a*a%util%1ateK import .a*a$%ser*let%Ser*let?$"eptionK import .a*a$%ser*let%http%<ttpSer*letK

import .a*a$%ser*let%http%<ttpSer*letRe)uestK import .a*a$%ser*let%http%<ttpSer*letResponseK

8WW W W Lauthor Jessy W8 publi" "lass "al"ulatebun- e$tends <ttpSer*let M

8WW W Cro"esses re)uests #or both <44C Q"odeT!?4Q8"odeT and Q"odeTC'S4Q8"odeT W methods% W W Lparam re)uest ser*let re)uest W Lparam response ser*let response W Lthro(s Ser*let?$"eption i# a ser*let-spe"i#i" error o""urs W Lthro(s &'?$"eption i# an &8' error o""urs W8 prote"ted *oid pro"essRe)uestA<ttpSer*letRe)uest re)uest, <ttpSer*letResponse responseB thro(s Ser*let?$"eption, &'?$"eption M response%set7ontent4ypeAJte$t8htmlK"harsetN 45-SJBK Crint9riter out N response%get9riterABK try M int "urrentHattenden"e N &nteger%parse&ntAre)uest%getCarameterAJ"urrentHattenden"eJBBK int le"turesHdeli*ered N &nteger%parse&ntAre)uest%getCarameterAJle"turesHdeli*eredJBBK int le"turesHattended N ;ath%roundAA"urrentHattenden"eWle"turesHdeli*eredB8100BK Simple1ate5ormat sd# N ne( Simple1ate5ormatAJdd-mm-yyyyJBK 1ate date1 N sd#%parseAJ10-01-2014JBK 1ate date2 N ne( 1ateABK

long timeHdi## N date2%get4imeAB-date1%get4imeABK int (ee-sHpassed N ;ath%roundAA#loatBtimeHdi##8AX0WX0W24W7W1000BBK int totalHle"tures N ;ath%roundAAA#loatBAle"turesHdeli*eredB8(ee-sHpassedBW14BK int le"turesHle#t N AtotalHle"tures - le"turesHdeli*eredBK int bun-s N le"turesHle#t - ;ath%roundAAA#loatB0%76WtotalHle"turesB - le"turesHattendedBK i#Abun-sT0B M re)uest%set2ttributeAJmsgJ,JGou "an bun- JDbun-sDJ le"tures out o# remaining JDle"turesHle#tDJ%JBK P else i#Abun-sNN0B M re)uest%set2ttributeAJmsgJ,J&# you bun- any o# the remaining le"tures, Gou may be detainedJBK P else M re)uest%set2ttributeAJmsgJ,JGou are detained alreadyJBK P re)uest%getRe)uest1ispat"herAJsho(bun-%.spJB%#or(ardAre)uest, responseBK P "at"hA?$"eption eB M

P P

88 Qeditor-#old de#aultstateNJ"ollapsedJ des"NJ<ttpSer*let methods% 7li"- on the D sign on the le#t to edit the "ode%JT 8WW

W <andles the <44C Q"odeT!?4Q8"odeT method% W W Lparam re)uest ser*let re)uest W Lparam response ser*let response W Lthro(s Ser*let?$"eption i# a ser*let-spe"i#i" error o""urs W Lthro(s &'?$"eption i# an &8' error o""urs W8 L'*erride prote"ted *oid do!etA<ttpSer*letRe)uest re)uest, <ttpSer*letResponse responseB thro(s Ser*let?$"eption, &'?$"eption M pro"essRe)uestAre)uest, responseBK P

8WW W <andles the <44C Q"odeTC'S4Q8"odeT method% W W Lparam re)uest ser*let re)uest W Lparam response ser*let response W Lthro(s Ser*let?$"eption i# a ser*let-spe"i#i" error o""urs W Lthro(s &'?$"eption i# an &8' error o""urs W8 L'*erride prote"ted *oid doCostA<ttpSer*letRe)uest re)uest, <ttpSer*letResponse responseB thro(s Ser*let?$"eption, &'?$"eption M pro"essRe)uestAre)uest, responseBK P

8WW W Returns a short des"ription o# the ser*let%

W W Lreturn a String "ontaining ser*let des"ription W8 L'*erride publi" String getSer*let&n#oAB M return JShort des"riptionJK P88 Q8editor-#oldT P

Se&&'on Bean

pa"-age sessionK

import entity%5a"ultyK import entity%5ood&temK import entity%Stationary&temK import entity%StudentK import .a*a%util%=istK import .a*a$%e.b%StatelessK import .a*a$%persisten"e%?ntity;anagerK import .a*a$%persisten"e%Cersisten"e7onte$tK

8WW W W Lauthor Jessy W8 LStateless publi" "lass Ne(Session@ean implements Ne(Session@ean=o"al M

LCersisten"e7onte$tAunitName N J tilityH9ebH2ppH#orH=o*elyHStudents-e.bC JB pri*ate ?ntity;anager emK

publi" *oid persistA'b.e"t ob.e"tB M em%persistAob.e"tBK P Student student N ne( StudentABK L'*erride publi" *oid addstudentAlong Regid,String pass(ord,String email,String hintOuestion,String hint2ns(er, String #ullName,long mobileNo,String bat"h,String programme,String i1,String i2,String i3B M student%setReg&dARegidBK student%setCass(ordApass(ordBK student%set?mailAemailBK student%set<intOuestionAhintOuestionBK student%set<int2ns(erAhint2ns(erBK student%set5ullNameA#ullNameBK student%set;obileNoAmobileNoBK student%set@at"hAbat"hBK student%setCrogrammeAprogrammeBK student%set&1Ai1BK student%set&2Ai2BK student%set&3Ai3BK em%persistAstudentBK P publi" =istQStationary&temT #indStationary&temAString itemNameB M return em%"reateOueryAJSele"t i #rom Stationary&tem i (here i%name li-e :aJB%setCarameterAJaJ, itemNameB%getResult=istABK

publi" =istQ5ood&temT #ind5ood&temAString itemNameB M return em%"reateOueryAJSele"t # #rom 5ood&tem # (here #%name li-e :aJB%setCarameterAJaJ, itemNameB%getResult=istABK P publi" =istQ5a"ultyT #ind5a"ultyAString nameB M return em%"reateOueryAJSele"t # #rom 5a"ulty # (here #%name li-e :aJB%setCarameterAJaJ, nameB%getResult=istABK P P

You might also like