Download as doc, pdf, or txt
Download as doc, pdf, or txt
You are on page 1of 53

QuestionNo: JMT1011 Question Which of the following options enables you to obtain filter initialization parameters?

1 The FilterConfig reference ! The "er#let$e%uest reference & The "er#let$esponse reference ' The (ilter)hain reference )orrect *ns: 1

QuestionNo: JMT101! Question The url+pattern element can be replace, with the --------- element to create a filter that applies to a particular ser#let. 1 filter+class ! ,ispatcher & filter+name 4, servlet-name )orrect *ns: '

QuestionNo: JMT101& Question Which of the following options ,oes N/T hol, true for 0*/ pattern? 1 1n,er the 0*/ pattern you can reuse the ,ata access co,e from other ser#lets. ! 1n,er the 0*/ pattern you can ma2e changes to bac2+en, technologies in,epen,ent of the front+en, technologies. 3, Under the DAO pattern, the Web tier comm nicates !ith the DAO classes" ' 1n,er the 0*/ pattern the business ser#ices ,o not nee, to 2now how the ,ata is store,.

)orrect *ns: & QuestionNo: JMT101' Question Martin has create, a Web application in which a ser#let stores a J03) 1$4 as an attribute of the session ob5ect to access a ,atabase. 6e wants other ser#lets of the application to retrie#e the 1$4 attribute from the session ob5ect to access the ,atabase. Which of the following co,e snippets can Martin use to retrie#e the 1$4 from the session ob5ect? #, $ttp%ession session & re' est"get%ession()* %tring rl &(%tring)session"getAttrib te(+U,-+)* ! 6ttp"ession session 7 re%uest.get"ession89: "tring url 7session.get*ttribute8;1$4;9: & "tring url 78"tring9session.get"ession8;1$4;9: ' 6ttp"er#let$e%uest session 7 re%uest.get"ession89: "tring url 78"tring9session.get*ttribute8;1$4;9: )orrect *ns: 1

QuestionNo: JMT101< Question Mar2 has create, a ser#let name, $egistration. The ser#let nee,s to be connecte, to the "tu,ents ,atabase. Which of the following tas2s is performe, first to accomplish this tas2? 1 The component uses the J03) *=> to communicate with the ,atabase by way of the connection. ., The component performs a /0D1 loo2 p on the naming service to retrieve the Data%o rce" & The component calls the prepare"tatement89 metho, on the 0ata"ource to retrie#e a ,atabase connection. ' The component calls the get)onnection89 metho, on the 0ata"ource to retrie#e a ,atabase connection. )orrect *ns: !

QuestionNo: JMT101? Question $onal, has obser#e, that his Web application has some 6TM4 tags or features that all the Web browsers ,o not support. >f the client@s browser ,oes not support the application may or may not run or may generate un,esire, output in the Web browser of the client. Therefore $onal, wants to i,entify the type of browser an, other specific information about the client that sen,s the re%uest to the Web application before in#o2ing the ser#let. Which of the following options will help $onal, pro#i,e this functionality? #, 34 programming filters ! 3y creating security constraints & 3y mo,ifying the web ,eployment ,escriptor ' 3y implementing the J"( technology

)orrect *ns: 1

QuestionNo: JMT101A Question Which of the following options can be use, by the controller to ,estroy a session of a web application? #, 34 sing the invalidate() method

! 3y setting the session+timeout parameter in the web.Bml file & 3y using the setMaB>nacti#e>nter#al89 metho, ' 3y using the ,estroy89 metho,

)orrect *ns: 1

QuestionNo: JMT101C

Question Wren has create, a ser#let that nee,s to be connecte, to a ,atabase. Wren ,eci,es to establish a connection in a ser#let an, then maintain that connection as a member #ariable of that ser#let. Which of the following ,rawbac2s is Wren li2ely to face? 1 =erformance problem ., Threading problem & Maintenance problem ' "pee, problem )orrect *ns: ! QuestionNo: JMT10'0 Question Jac2 "mith is wor2ing as a Ja#a ,e#eloper in =. Tech 4t,. 6e is ,e#eloping a web application using "er#lets an, J"=. 6e ,eci,es to use (ilters in the web application. 6e has to ensure that the filter woul, only be applie, to internal ,ispatches to the 1$4 pattern D.,o an, not to any ,irect client re%uests. 6e uses the following co,e to ,eclare the filter mapping: Efilter+mappingF Efilter+nameFau,it(ilterEGfilter+nameF Eurl+patternFD.,oEGurl+patternF E,ispatcherF$HQ1H"TEG,ispatcherF EGfilter+mappingF 6owe#er the abo#e co,e ma2e the au,it(ilter apply to the ,irect client re%uests for a 1$4 which matches D.,o pattern. >,entify the error an, pro#i,e the solution. 1 $eplace the co,e with the following: Efilter+mappingF Efilter+nameFau,it(ilterEGfilter+nameF Eurl+patternFD.,oEGurl+patternF E,ispatcherFre%uestEG,ispatcherF EGfilter+mappingF ! $eplace the co,e with the following: Efilter+mappingF Efilter+nameFau,it(ilterEGfilter+nameF Eurl+patternFD.,oEGurl+patternF E,ispatcherFH$$/$EG,ispatcherF EGfilter+mappingF

& $eplace the co,e with the following: Efilter+mappingF Efilter+nameFau,it(ilterEGfilter+nameF Eurl+patternFD.,oEGurl+patternF E,ispatcherFinclu,eEG,ispatcherF EGfilter+mappingF 4, ,eplace the code !ith the follo!ing5 6filter-mapping7 6filter-name7a ditFilter68filter-name7 6 rl-pattern79"do68 rl-pattern7 6dispatcher710C-UD:68dispatcher7 6dispatcher7FO,WA,D68dispatcher7 68filter-mapping7 )orrect *ns: ' QuestionNo: JMT10'1 Question Jac2 "mith is wor2ing as a Ja#a ,e#eloper in =. Tech 4t,. 6e is ,e#eloping a web application using "er#lets an, J"=. 6e ,eci,es to use (ilters in the web application. 6e has to ensure that the filter woul, only be applie, to ,irect client re%uests for a 1$4 which matches the D.,o pattern an, not to internal ,ispatches. 6e uses the following co,e to ,eclare the filter mapping: Efilter+mappingF Efilter+nameFau,it(ilterEGfilter+nameF Eurl+patternFD.,oEGurl+patternF E,ispatcherF>N)410HEG,ispatcherF E,ispatcherF(/$W*$0EG,ispatcherF EGfilter+mappingF 6owe#er the abo#e co,e ma2e the au,it(ilter apply to the internal ,ispatches for a 1$4 which matches D.,o pattern. >,entify the error an, pro#i,e the solution. 1 $eplace the co,e with the following: Efilter+mappingF Efilter+nameFau,it(ilterEGfilter+nameF Eurl+patternFD.,oEGurl+patternF E,ispatcherFH$$/$EG,ispatcherF EGfilter+mappingF

! $eplace the co,e with the following: Efilter+mappingF Efilter+nameFau,it(ilterEGfilter+nameF Eurl+patternFD.,oEGurl+patternF E,ispatcherF(/$W*$0EG,ispatcherF EGfilter+mappingF & $eplace the co,e with the following: Efilter+mappingF Efilter+nameFau,it(ilterEGfilter+nameF Eurl+patternFD.,oEGurl+patternF E,ispatcherF>N)410HEG,ispatcherF EGfilter+mappingF 4, ,eplace the code !ith the follo!ing5 6filter-mapping7 6filter-name7a ditFilter68filter-name7 6 rl-pattern79"do68 rl-pattern7 6dispatcher7,:;U:%T68dispatcher7 68filter-mapping7 )orrect *ns: ' QuestionNo: JMT10'! Question Jac2 "mith is wor2ing as a Ja#a ,e#eloper in =. Tech 4t,. 6e is ,e#eloping a web application using "er#lets an, J"=. 6e ,eci,es to use (ilters in the web application. 6e uses the following co,e to ,eclare the filter in the application: EfilterF Efilter+nameFperf(ilterEGfilter+nameF Einit+paramF Eparam+nameF4og Hntry =refiBEGparam+nameF Eparam+#alueF=erformance: EGparam+#alueF EGinit+paramF EGfilterF 6owe#er the abo#e co,e is incomplete in terms of filter ,eclaration. >,entify the error? #, filter-class element is missing in the filter declaration" ! ser#let+name element is missing in the filter ,eclaration.

& ser#let+mapping element is missing in the filter ,eclaration. ' url+pattern element is missing in the filter ,eclaration. )orrect *ns: 1

QuestionNo: JMT10'' Question )onsi,er the co,e for filter mapping in the web application ,eployment ,escriptor file: Eser#let+mappingF Eser#let+nameFMy)ontrollerEGser#let+nameF Eurl+patternFD.,oEGurl+patternF EGser#let+mappingF 19Efilter+mappingF Efilter+nameF(irstEGfilter+nameF Eser#let+nameFMy)ontrollerEGser#let+nameF EGfilter+mappingF !9Efilter+mappingF Efilter+nameF"econ,EGfilter+nameF Eser#let+nameFMy)ontrollerEGser#let+nameF EGfilter+mappingF &9 Efilter+mappingF Efilter+nameFThir,EGfilter+nameF Eurl+patternFD.,oEGurl+patternF EGfilter+mappingF '9Efilter+mappingF Efilter+nameF(ourthEGfilter+nameF Eurl+patternFD.,oEGurl+patternF EGfilter+mappingF =re,ict the or,er in which filter will be applie, if the re%uest was ma,e for the 1$4 Ga,minGa,,-league.,o? 1 (irstF"econ,FThir,F(ourth .,Third7Fo rth7First7%econd & (ourthFThir,F"econ,F(irst ' "econ,F(irstF(ourthFThir,

)orrect *ns: ! QuestionNo: JMT10'< Question * co,e for filter mapping has to be written for a filter calle, 4ogin (ilter for components in such a manner that it shoul, be applie, to component whene#er an error occurs. =re,ict the co,e for filter mapping to perform the re%uire, tas2 from the following options. 1 Efilter+mappingF Efilter+nameF4ogin(ilterEGfilter+nameF E,ispatcherFH$$/$EG,ispatcherF EGfilter+mappingF .,6filter-mapping7 6filter-name7-oginFilter68filter-name7 6 rl-pattern79"do68 rl-pattern7 6dispatcher7:,,O,6dispatcher7 68filter-mapping7 & Efilter+mappingF Efilter+nameF4ogin(ilterEGfilter+nameF E,ispatcherFH$$/$EG,ispatcherF Eurl+patternFH$$/$.,oEGurl+patternF EGfilter+mappingF ' Efilter+mappingF Efilter+nameF4ogin(ilterEGfilter+nameF Eurl+patternFD.,oEGurl+patternF E,ispatcherF,ispatcher.H$$/$EG,ispatcherF EGfilter+mappingF )orrect *ns: ! QuestionNo: JMT10'A Question "tem teBt : )onsi,er the following co,e regar,ing accessing of session attributes in a sessionmanagement program. 3ut this program has few errors. =re,ict the correct co,e for the program. "tring login7re%uest.get=arameterIalue8;login;9: if8login.e%uals8;tim;9 J return mapping.(orwar,8error9: K

if8login.e%uals8;0a#i,;9 J return mapping.(orwar,8success9: K where mapping is an ob5ect of *ctionMapping )lass. 1 "tring login7re%uest.get=arameter8;login;9: if8login.e%uals8;tim;9 J return mapping.(orwar,8;error;9: K if8login.e%uals8;0a#i,;9 J return mapping.(orwar,8;success;9: K ! "tring login7re%uest.get=arameter8;login;9: if8login.e%uals8;tim;9 J return mapping.fin,(orwar,8error9: K if8login.e%uals8;0a#i,;9 J return mapping.fin,(orwar,8success9: K & "tring login7re%uest.get=arameterIalue8;login;9: if8login.e%uals8;tim;9 J return mapping.fin,(orwar,8;error;9: K if8login.e%uals8;0a#i,;9 J return mapping.fin,(orwar,8;success;9: K 4,%tring login&re' est"get<arameter(+login+)* if(login"e' als(+tim+) = ret rn mapping"findFor!ard(+error+)* > if(login"e' als(+David+) = ret rn mapping"findFor!ard(+s ccess+)*

> )orrect *ns: ' QuestionNo: JMT10<! Question Lou ha#e ,eploye, two ser#lets name, ser#let1 an, ser#let! in your Web ser#er. Lou want to create an attribute calle, ;customernumber; an, assign the #alue of a #ariable cnum to it. Which of the following co,es is the correct metho, for ,oing it? 1 "er#let)onteBt c7get"er#let)onteBt89: c.set*ttribute8cnum ;customernumber;9: ! "er#let)onfig c7get"er#let)onfig89: c.set*ttribute8cnum ;customernumber;9: 3,%ervletConte?t c&get%ervletConte?t() c"setAttrib te(+c stomern mber+, cn m) ' "er#let)onfig c7get"er#let)onfig89: c.set*ttribute8;customernumber; cnum9: )orrect *ns: & QuestionNo: JMT10C& Question Which metho, is use, for ,estroying the 6ttp"ession instance? 1 ,estroy"ession89 ! ,estroy89 3,invalidate() ' close89 )orrect *ns: &

QuestionNo: JMT10C< Question Which metho, of 6ttp"ession interface is use, for specifying the length of inacti#e inter#al for a session ob5ect? 1 setMaB>nter#al89

.,set@a?1nactive1nterval() & setMaB>nacti#e-inter#al89 ' set>nacti#e>nter#al89 )orrect *ns: !

QuestionNo: JMT10M1 Question Which metho, can be use, for a,,ing coo2ies to the response ob5ect? 1 a,,89 ! a,,)oo2ies89 3,addCoo2ie() ' a,,)oo2ie4ist89 )orrect *ns: & QuestionNo: JMT10MA Question Which metho, of (ilter interface is use, to ,eci,e whether to call the neBt component in the filter chain or incoming re%uest has to be bloc2e,? 1 ser#ice89 ! eBecute89 3,doFilter() ' init89 )orrect *ns: &

QuestionNo: JMT101M Question MaB is creating an application using the "truts framewor2. 6e has to ,e#elop the action form. Which of the following options shoul, he ensure while creating the action form? 1 The action form shoul, not contain co,e to #ali,ate ,ata.

! The action form shoul, not perform any ,ata con#ersions. 3, The action form sho ld not contain different names for the get and set methods from the $T@- form elements the4 represent" ' The action form shoul, not retrie#e any ,ata from the incoming re%uest. )orrect *ns: &

QuestionNo: JMT10!0 Question 6arol, has obser#e, that some users are able to ,irectly access the content files store, in the Web application from the Web browser. Which of the following options shoul, 6arol, use to pre#ent the users from ,irectly accessing the content files? 1 3y storing the content files un,er the ,ist ,irectory ! 3y storing the content files un,er the MHT*+>N( ,irectory 3, 34 storing the content files nder the W:3-10F director4

' 3y storing the content files un,er the >N( ,irectory )orrect *ns: &

QuestionNo: JMT10!1 Question Thomas wants to implement the eBecute89 metho, of the *ction class in his controller class. Which of the following tas2s ,oes he nee, to perform to use the accessor metho,s on the form bean? 1 Thomas nee,s to write co,e to retrie#e the form parameters. ! Thomas nee,s to write co,e to con#ert the ,ata. & Thomas nee,s to write co,e to perform #erification. 4, Thomas needs to cast the generic ActionForm to his applicationspecific class" )orrect *ns: '

QuestionNo: JMT10!!

Question *ngelina is creating an application using the "truts framewor2. The application consists of multiple #iew pages. Now *ngelina nee,s to pass ,ifferent #alues for the ,ifferent #iew pages. "he ,eci,es to create layout files for the same. Which of the following options will help *ngelina perform the tas2 %uic2ly? 1 )reate a layout file for each #iew page to pass the #alues for the respecti#e #iew page. ! )reate a layout file an, specify its location in the sunweb.Bml file. & )reate a layout file an, specify its location in the strutsconfig.Bml file. 4, Create a la4o t file )orrect *ns: ' QuestionNo: JMT10'? Question =re,ict the correct co,e for the ,eclaration of a form bean calle, employeeform in the struts framewor2? 1 import org.apache.struts.action.*ction(orm: public class employeeform implements *ction(orm J GGre%uire, co,e K .,import org"apache"str ts"action"ActionForm* p blic class emplo4eeform e?tends ActionForm = 88re' ired code > & import org.apache.struts.*ction(orm: public class employeeform eBten,s *ction(orm J GGre%uire, co,e K ' import org.apache.struts.action.*ction(orm: public class employeeform J GGre%uire, co,e K sing Tiles"

)orrect *ns: ! QuestionNo: JMT10'C Question 6arry wants to create a form bean in struts framewor2. 6e wants to perform certain #ali,ations for that form bean. Which class he shoul, use to create a form bean an, which metho, he shoul, use to perform the #ali,ations for the form bean? 1 *ction(orm )lass N ,oIali,ate89 metho, ! *ction )lass N Iali,ate89 metho, 3,ActionForm Class A validate() method ' *ction(orm )lass N performIali,ations89 metho, )orrect *ns: &

QuestionNo: JMT10'M Question * Web application ,e#elope, for an e,ucational institution re%uires insertion of a hea,er file comprising the logo an, institution name. >,entify the correct J"= tag from the options gi#en below to a,, the logo an, institution name to all the pages of the Web application. 1 Eform metho,7;post; action7;6ea,er.html;F .,6BC incl de file&+$eader"html+ B7 & E5sp:forwar, page7;6ea,er.html;F ' EOP page import7;6ea,er.html; OF )orrect *ns: !

QuestionNo: JMT10<< Question )onsi,er the following statements: *9 The ,oIali,ate89 metho, is use, to perform #ali,ation of (orm (iel,s. 39 "truts pro#i,es a mechanism to store form ,ata into a 5a#abeans instance. )9 0ata )on#ersion can be performe, by the *ction(orm )lass.

09 The #ali,ate attribute in the action tag ,etermines whether #ali,ation will occur for the form bean or not. Which of the following options is True with respect to the abo#e statements? 1 "tatement * 3 ) are true an, 0 is false. .,%tatement A is False and 3,C,D are tr e" & "tatement * 3 are true an, ) 0 are (alse. ' "tatement * 3 0 are true an, ) is (alse. )orrect *ns: !

QuestionNo: JMT10A0 Question Which of the following is N/T passe, as an argument to the eBecute metho, of the *ction class in the "truts framewor2? 1 *ctionMapping ., $ttp%ervlet & *ction(orm ' 6ttp"er#let$e%uest )orrect *ns: !

QuestionNo: JMT10M& Question What ,oes the #ali,ate attribute in the action tag ,o? 1 Iali,ates the user name an, passwor, .,Determines !hether validation !ill occ r for the form bean & *uthenticates the user to ,etermine the permissions in an application ' =erforms the ,ata con#ersion in an application )orrect *ns: ! QuestionNo: JMT10M' Question What is return type of #ali,ate metho, in struts framewor2?

1 *ctionHrror .,Action:rrors & *ction(orwar, ' *ctionMapping )orrect *ns: !

QuestionNo: JMT10MC Question Which of the following is not the attribute ta2en by the *ction Tag in the struts configuration file? 1 name ! scope & #ali,ate 4,invalidate )orrect *ns: '

QuestionNo: JMT1100 Question Which of the following options is an eBample of a profit+base, organization? #, 1ns rance ! Qo#ernment+fun,e, uni#ersities & 6uman rights commissions ' Wor2er unions )orrect *ns: 1

QuestionNo: JMT1101 Question )onsi,er the following statements: "tatement *: The )ontinuous =rocess >mpro#ement of business processes helps ensure that the eBisting processes stay efficient.

"tatement 3: )ontinuous =rocess >mpro#ement focuses on the critical elements of a business process an, eliminates the elements that ,o not a,, any #alue. Which of the following options is correct in conteBt of the prece,ing statements? 1 "tatement * is true an, "tatement 3 is false. ! "tatement * is false an, "tatement 3 is true. & "tatement * an, "tatement 3 are false. 4, %tatement A and %tatement 3 are tr e" )orrect *ns: '

QuestionNo: JMT110! Question Lou are wor2ing as a sales hea, in >T"oft >nc. Lou ha#e to create policies an, strategies for the new financial year so as to enable the organization to generate more re#enue an, earn more profit. (or this you nee, to create an annual sales target report to 5ustify the policies an, strategies that you will create. Which of the following systems enables you to accomplish the prece,ing tas2s? 1 /nline Transaction =rocessing "ystem ! Management >nformation "ystem & Transaction =rocessing "ystem 4, Decision % pport %4stem )orrect *ns: '

QuestionNo: JMT110& Question Lou are wor2ing as a senior manager in a retail organization. Lou want to impro#e the process of procuring of raw material manufacturing of goo,s an, selling of pro,uct to the en,+user so as to re,uce the tas2s in#ol#e, in maintaining the in#entory. Which of the following technology components will you implement to accomplish the prece,ing tas2? 1 Transaction =rocessing "ystem ., % ppl4 Chain @anagement

& Hnterprise $esource =lanning ' )ustomer $elationship Management )orrect *ns: ! QuestionNo: JMT110' Question Which of the following 2ey attributes of a ser#ice helps you to ensure more customers through the reference of ol, customers? 1 >ntangible ! =erishable & Wor2force intensi#e 4, ,elationship specific )orrect *ns: '

QuestionNo: JMT110< Question Which of the following processes in#ol#es writing the financial transactions such as purchase of raw materials an, sale of manufacture, goo,s in an or,erly manner? #, ,ecording ! )lassifying & *nalyzing an, interpreting ' *nalyzing an, planning )orrect *ns: 1

QuestionNo: JMT110? Question Which of the following options ser#e as an entry point of business an, economic transactions? 1 Trial 3alance ., /o rnal & 3alance sheet ' 4e,ger

)orrect *ns: !

QuestionNo: JMT110A Question William wante, to purchase music 0I0s )0s an, boo2s from TuneMe >nc. 6e has accepte, the estimate, price an, terms an, con,itions gi#en by TuneMe the items. Now he has to sen, a ,ocument that consists of the following components: 1. *,,ress where the pro,ucts ha#e to be ,eli#ere,. !. Number of items that is to be purchase,. &. Types of Music 0I0s an, )0s an, boo2s. Which of the following ,ocuments will William use to specify the abo#e components an, sen, to TuneMe >nc? 1 Quotation ! >n#oice 3, < rchase order ' =erforma in#oice )orrect *ns: &

QuestionNo: JMT110C Question Lou are wor2ing as a ,ata analyst in 4arge"ou2 >nc. Lou are analyzing the ,ata to create mar2eting strategies an, policies for launching a new pro,uct. (or this you want ,ata on inflation rates current go#ernment policies an, regulations interest rates an, social tren,s. Which of the following en#ironmental factors will allow you to gather the prece,ing ,ata? #, Climate ! )ustomers & )ollaborators ' )ompany )orrect *ns: 1

QuestionNo: JMT110M Question Lou are wor2ing as a mar2eting eBecuti#e in MunchMore >nc. Lou nee, to prepare campaign ,ata for the pro,uct that is to be launche, in the neBt %uarter. Which of the following se%uences of steps will you perform to create the campaign ,ata? #, ." 3" 4" ! !. &. '. & !. &. '. ' !. &. '. #" Det lead database information" Denerate campaign" %tore campaign details in the database" <repare the campaign activit4" 1. Qet lea, ,atabase information. Qenerate campaign. =repare the campaign acti#ity. "tore campaign ,etails in the ,atabase. 1. Qenerate campaign. Qet lea, ,atabase information. "tore campaign ,etails in the ,atabase. =repare the campaign acti#ity. 1. Qet lea, ,atabase information. =repare the campaign acti#ity. Qenerate campaign. "tore campaign ,etails in the ,atabase.

)orrect *ns: 1

QuestionNo: JMT1110 Question Jones is wor2ing as an accountant in Qarb*ttire >nc. "he has to prepare a =rofit an, 4oss *ccount to get the information to control the organization eBpenses. 6ow will Jones prepare a =rofit an, 4oss *ccount in case of the loss shown by the result of tra,ing account? 1 3y performing the following steps: 1.Write all the entries relate, to in,irect eBpenses on the ,ebit si,e an, all the entries relate, to the incomes an, gains on the cre,it si,e.

!.Write the amount of gross loss on the ,ebit si,e of the profit an, loss account un,er the entry RTo Qross 4oss bG,S. &.)alculate total for both the ,ebit si,e an, cre,it si,e an, compare them. '.Write the total at the en, of the *mount columns on both the si,es. <.Write the ,ifference between the two totals on the cre,it si,e un,er the entry RTo Net 4oss transferre, to capital accountS. ! 3y performing the following steps: 1.Write all the entries relate, to in,irect eBpenses on the ,ebit si,e an, all the entries relate, to the incomes an, gains on the cre,it si,e. !.Write the amount of gross loss on the ,ebit si,e of the profit an, loss account un,er the entry RTo Qross 4oss bG,S. &.)alculate total for both the ,ebit si,e an, cre,it si,e an, compare them. '.Write the ,ifference between the two totals on the cre,it si,e un,er the entry RTo Net 4oss transferre, to capital accountS. <.Write the total at the en, of the *mount columns on both the si,es. & 3y performing the following steps: 1.Write the amount of gross loss on the ,ebit si,e of the profit an, loss account un,er the entry RTo Qross 4oss bG,S. !.Write all the entries relate, to in,irect eBpenses on the ,ebit si,e an, all the entries relate, to the incomes an, gains on the cre,it si,e. &.)alculate total for both the ,ebit si,e an, cre,it si,e an, compare them. '.Write the total at the en, of the *mount columns on both the si,es. <.Write the ,ifference between the two totals on the cre,it si,e un,er the entry RTo Net 4oss transferre, to capital accountS. 4,34 performing the follo!ing steps5 #"Write the amo nt of gross loss on the debit side of the profit and loss acco nt nder the entr4 ETo Dross -oss b8dF" ."Write all the entries related to indirect e?penses on the debit side and all the entries related to the incomes and gains on the credit side" 3"Calc late total for both the debit side and credit side and compare them" 4"Write the difference bet!een the t!o totals on the credit side nder the entr4 ETo 0et -oss transferred to capital acco ntF" G"Write the total at the end of the Amo nt col mns on both the sides" )orrect *ns: '

QuestionNo: JMT1111 Question Lou are wor2ing as an accountant in Ien,"oft >nc. Lou nee, to create a le,ger account using Tally. Which of the following se%uences of steps will you perform to accomplish the prece,ing tas2? 1 1. "elect *ccounts>nfo++F4e,gers++F)reate. !. =ress Hnter to go to the 1n,er fiel, an, select the group of the account sun,ry cre,itors from the list ,isplaye, on the right si,e of the Tally pane. &. Hnter the name of the le,ger in the Name teBtboB. '. "elect options to sa#e the ,etails of the le,ger. ! 1. "elect *ccounts>nfo++F4e,gers++F)reate. !. Hnter the name of the le,ger in the Name teBtboB. &. "elect options to sa#e the ,etails of the le,ger. '. =ress Hnter to go to the 1n,er fiel, an, select the group of the account sun,ry cre,itors from the list ,isplaye, on the right si,e of the Tally pane. 3, #" %elect Acco nts1nfo--7-edgers--7Create" ." :nter the name of the ledger in the 0ame te?tbo?" 3" <ress :nter to go to the Under field and select the gro p of the acco nt, s ndr4 creditors from the list displa4ed on the right side of the Tall4 pane" 4" %elect options to save the details of the ledger" ' 1. "elect *ccounts>nfo++F4e,gers++F)reate. !. =ress Hnter to go to the 1n,er fiel, an, select the group of the account sun,ry cre,itors from the list ,isplaye, on the right si,e of the Tally pane. &. "elect options to sa#e the ,etails of the le,ger. '. Hnter the name of the le,ger in the Name teBtboB. )orrect *ns: & QuestionNo: JMT10?0 Question The web container maintains a pool of instances that is large enough to han,le a number of simultaneous --------------------. 1 )lients ! $esponses

3,,e' ests ' "er#ers )orrect *ns: & QuestionNo: JMT10?! Question ----------------- creates a new re%uest an, response ob5ect for each new re%uest that it han,les. 1 HJ3 )ontainer ! "er#let 3,Web Container ' J"= =age )orrect *ns: &

QuestionNo: JMT10?& Question Which of the following programs runs in a separate threa, in the Web container for each client re%uest? 1 6TM4 ., %ervlets & )Q> ' =earl )orrect *ns: !

QuestionNo: JMT10?' Question Lou are creating a Web application. (or this you ha#e to ,efine #arious 5ob roles in your Web application team. /ne of the 5ob roles re%uires creating Iiew elements such as 6TM4 pages or ,ynamically generate, pages. >,entify the 5ob role. 1 Web )omponent 0e#eloper ., Web Designer & 3usiness )omponent 0e#eloper

' 0ata *ccess 0e#eloper )orrect *ns: !

QuestionNo: JMT10?< Question Lou are creating a Web application. (or this you ha#e to ,efine #arious 5ob roles in your Web application team. /ne of the 5ob roles re%uires creating )ontroller elements which consist mostly of ser#lets. >,entify the 5ob role. #, Web Component Developer ! Web 0esigner & 3usiness )omponent 0e#eloper ' 0ata *ccess 0e#eloper )orrect *ns: 1

QuestionNo: JMT10?? Question Which metho, can be use, to submit form ,ata that shoul, not be eBpose, for #iewing? 1 =1T ! QHT 3,<O%T ' $HQ1H"T )orrect *ns: &

QuestionNo: JMT10?A Question Lou are creating a Web application. (or this you ha#e to ,efine #arious 5ob roles in your Web application team. /ne of the 5ob roles re%uires creating Mo,el elements that might eBist on the web tier as stan,ar, Ja#a technology classes. >,entify the 5ob role. 1 Web )omponent 0e#eloper ! Web 0esigner

3, 3 siness Component Developer ' 0ata *ccess 0e#eloper )orrect *ns: & QuestionNo: JMT10?M Question 6ttp"er#let$e%uest is a sub interface of ------------. 1 6ttp$e%uest .,%ervlet,e' est & 6ttp"er#let ' >t is not a sub+interface )orrect *ns: !

QuestionNo: JMT10A1 Question Whene#er a re%uest goes from the client to the ser#er some a,,itional information other than the re%uest is also passe, to the ser#er. This a,,itional information is in the form of a ------------. 1 footer .,header & *pplication >0 ' "ession >0 )orrect *ns: !

QuestionNo: JMT10A& Question Which metho, of the 6ttp"er#let class is implemente, to filter incoming re%uests by type? #,service ! ,oQet & ,o=ost ' ,o=ut

)orrect *ns: 1

QuestionNo: JMT10A' Question Which of the following action is not performe, by ser#lets? 1 $etrie#e form ,ata ! $etrie#e security information & Qenerate output 4,Chec2 compilation errors )orrect *ns: '

QuestionNo: JMT10A< Question Which of the following is Not the 6TT= $e%uest 6ea,er? 1 *ccept ! 6ost & $eferer 4,,etrieve )orrect *ns: '

QuestionNo: JMT10A? Question Which metho, returns an enumeration of string compose, of the names of each hea,er in the re%uest stream? #,get$eader0ames() ! get6ea,er>nfo89 & get6ea,er89 ' get6ea,erName89 )orrect *ns: 1

QuestionNo: JMT10AA Question "er#lets tie up files to in,epen,ently han,le the static presentation logic an, the ,ynamic business logic. Which files are use, for han,ling presentation logic an, business logic? #,"html and "Hava ! *ll the co,e can be written in a .html file & .html an,.tBt ' .tBt an, .5sp )orrect *ns: 1

QuestionNo: JMT10AC Question >n the inter ser#let communication which metho, of the ser#let *=> is use, to store ob5ect information in the $e%uest /b5ect? 1 set/b5ect89 ! sa#e*ttribute89 3,setAttrib te() ' sa#e/b5ect89 )orrect *ns: &

QuestionNo: JMT10C' Question Which of the following is N/T T$1H for the ser#let ? 1 "er#lets are =latform >n,epen,ent. ! "er#lets are robust an, ob5ect oriente,. 3,%ervlets onl4 contains b siness logic" ' Hach re%uest in ser#let runs in separate threa,. )orrect *ns: &

QuestionNo: JMT111! Question )lara is ,e#eloping the home page of a website using ser#lets. "he wants the image in the Welcome.5pg file to be ,isplaye, on the home page. Which of the following metho,s shoul, )lara use to generate the response? #, getO tp t%tream() ! getWriter89 & set6ea,er89 ' get6ea,er89 )orrect *ns: 1 QuestionNo: JMT111& Question =re,ict the output of the following co,e: import 5a#a.io.D: import 5a#a.net.D: import 5a#aB.ser#let.D: import 5a#aB.ser#let.http.D: public class earnmore eBten,s 6ttp"er#let J public #oi, ,oQet86ttp"er#let$e%uest re%uest 6ttp"er#let$esponse response9 throws >/HBception J "tring pageTitle 7 ;Welcome to HarnMore 3an2;: response.set)ontentType8;teBtGhtml;9: out.println8;EhtmlF;9: out.println8;Ebo,yF;9: out.println8pageTitle9: out.println8;EGbo,yF;9: out.println8;EGhtmlF;9: K K 1 The co,e will compile an, eBecute successfully. The string Welcome to HarnMore 3an2 will be ,isplaye,. ! The co,e will compile successfully but gi#e a runtime error. & The co,e will ,isplay a blan2 page. 4, The code !ill give compilation error" )orrect *ns: ' QuestionNo: JMT111'

Question Jennifer has create, an 6TM4 form that accepts two numbers from the user. This form contains a button. When this button is clic2e, the numbers are passe, to a ser#let. Jennifer creates a ser#let name, )alculate to calculate the sum of the numbers entere, by the user. "he then creates another ser#let name, 0isplay to ,isplay this sum. Now she wants the sum calculate, by the )alculate ser#let to be passe, to the 0isplay ser#let. The co,e of the )alculate ser#let is: import 5a#aB.ser#let.D: import 5a#aB.ser#let.http.D: import 5a#a.io.D: public class )alculate eBten,s 6ttp"er#let J public #oi, ,oQet86ttp"er#let$e%uest re%uest 6ttp"er#let$esponse response9 throws "er#letHBception >/HBception J int num17>nteger.parse>nt8re%uest.get=arameter8;number1;99: int num!7>nteger.parse>nt8re%uest.get=arameter8;number!;99: int result7 num1Tnum!: K Which of the following co,e snippets will help Jennifer use to pro#i,e the re%uire, functionality? 1 re%uest.set*ttribute8;result; new >nteger8result99: $e%uest0ispatcher re%0isp7re%uest.get$e%uest0ispatcher8;G0isplay;9: re%0isp.forwar,8re%uest response9: ! $e%uest0ispatcher re%0isp7re%uest.get$e%uest0ispatcher8;G0isplay;9: re%0isp.forwar,8re%uest response9: 3, re' est"setAttrib te(+res lt+,ne! 1nteger(res lt))* ,e' estDispatcher re'Disp&re' est"get,e' estDispatcher(+Displa4+)* re'Disp"for!ard(re' est,response)* ' response.set*ttribute8;result; new >nteger8result99: $e%uest0ispatcher re%0isp7re%uest.get$e%uest0ispatcher8;0isplay;9: re%0isp.forwar,8re%uest response9: K

)orrect *ns: &

QuestionNo: JMT111< Question Michelle has create, the 6ello ser#let that ,isplays Welcome in the browser win,ow. The co,e of the ser#let is: pac2age myworl,: import 5a#a.io.>/HBception: import 5a#a.io.=rintWriter: import 5a#aB.ser#let."er#let)onfig: import 5a#aB.ser#let."er#letHBception: import 5a#aB.ser#let.http.6ttp"er#let: import 5a#aB.ser#let.http.6ttp"er#let$e%uest: import 5a#aB.ser#let.http.6ttp"er#let$esponse: public class hello eBten,s 6ttp"er#let J protecte, #oi, ,oQet86ttp"er#let$e%uest re%uest 6ttp"er#let$esponse response9 throws "er#letHBception >/HBception J =rintWriter out 7 response.getWriter89: out.println8;EhtmlF;9: out.println8;Ehea,F;9: out.println8;EtitleFMy "er#letEGtitleF;9: out.println8;EGhea,F;9: out.println8;Ebo,yF;9: out.println8;Eh1FWH4)/MHEGh1F;9: out.println8;EGbo,yF;9: out.println8;EGhtmlF;9:

out.close89: K K Which of the following co,e snippets correctly ,efines the ,eployment ,escriptor for the prece,ing ser#let? 1 Eser#letF Eser#let+nameFhelloEGser#let+nameF Eser#let+classFhelloEGser#let+classF EGser#letF Eser#let+mappingF Eser#let+nameFhelloEGser#let+nameF Eurl+patternFGhelloEGurl+patternF EGser#let+mappingF ., 6servlet7 6servlet-name7hello68servlet-name7 6servlet-class7m4!orld"hello68servlet-class7 68servlet7 6servlet-mapping7 6servlet-name7hello68servlet-name7 6 rl-pattern78hello68 rl-pattern7 68servlet-mapping7 & Eser#letF Eser#let+nameFmyworl,.helloEGser#let+nameF Eser#let+classFhelloEGser#let+classF EGser#letF Eser#let+mappingF Eser#let+nameFhelloEGser#let+nameF Eurl+patternFGhelloEGurl+patternF EGser#let+mappingF ' Eser#letF Eser#let+nameFhelloEGser#let+nameF Eser#let+classFmyworl,.helloEGser#let+classF EGser#letF Eser#let+mappingF Eser#let+nameFhelloEGser#let+nameF Eurl+patternFhelloEGurl+patternF EGser#let+mappingF

)orrect *ns: ! QuestionNo: JMT1001 Question =aul has create, a bean calle, myclass that wraps a collection of stu,ent ob5ects. 6e has written the following co,e snippet to iterate o#er the myclass bean an, pro,uce one row for each stu,ent: Ec:forHach #ar7;stu,ent; items7;UJmyclass.myclassK;F EtrF Et,FUJstu,ent.nameKEGt,F Et,FUJstu,ent.ageKEGt,F Et,FUJstu,ent.heightKEGt,F EGtrF EGc:forHachF Now =aul wants to write the prece,ing co,e snippet using scriptlets an, unor,ere, list. Which of the following co,e snippets fulfills =aul@s re%uirement? #, 6 l7 6B 1terator items & m4class"iterator()* !hile ( items"has0e?t() ) = m4class m4class# & (m4class) items"ne?t()* B7 6li76B& st dent"getTitle() B768li7 6B > B7 68 l7 ! EulF EO >terator items 7 myclass.iterator89: while 8 items.hasNeBt89 9 J myclass myclass1 7 items.neBt89: OF EliFEO7 stu,ent.getTitle89 OFEGliF EO K OF EGulF & EulF EO >terator items 7 myclass.iterator89: myclass myclass1 7 8myclass9 items.neBt89: OF EliFEO7 stu,ent.getTitle89 OFEGliF EO K OF EGulF

' EulF EO >terator items 7 myclass.iterator89: while 8 items.hasNeBt89 9 J myclass myclass1 7 8myclass9 items.neBt89: OF EliFEO7 myclass.getTitle89 OFEGliF EO K OF EGulF )orrect *ns: 1 QuestionNo: JMT100! Question 4in,a has create, a ser#let that accepts the name phone number a,,ress an, e,ucational %ualifications of the user. The ser#let contains teBt fiel,s to enter the name phone number an, a,,ress. >t contains a ,rop+ ,own list from which the user can select the %ualifications. 4in,a wants the ,rop+,own list to be populate, with the #alues 10T! gra,uation an, post gra,uation after the ser#let instance is create,. >n which of the following metho,s shoul, 4in,a place the co,e to populate the ,rop+,own list? 1 get"er#let)onfig89 ! get=arameter89 & ser#ice89 ' init89 )orrect *ns: ' QuestionNo: JMT10<0 Question Which of the following lines of co,e can be use, for a,,ing a pre+ ,efine, applet name, chat*pp to a J"= page? The chat*pp class file is present in the Gapplets ,irectory. 1 E5sp:plugin type7;applet; co,e7;chat*pp.class; co,ebase7;Gapplets; wi,th7;'00; height 7 ;&00;F EG5sp:pluginF ! E5sp:plugin type7;applet; co,e7;chat*pp.class; co,ebase7;applets; wi,th7;'00; height 7 ;&00;;F EG5sp:pluginF & E5sp:plugin type7;applet; co,e7;chat*pp.class; co,ebase7;Gapplets; wi,th7;'00; height 7 ;&00;GF

' E5sp:plugin co,e7;chat*pp.class; co,ebase7;Gapplets; wi,th7;'00; height 7 ;&00F EG5sp:pluginF )orrect *ns: 1 QuestionNo: JMT10<1 Question What will be the output of the following co,e snippet: EOP page language7;5a#a;OF EhtmlF Ehea,FEGhea,F Ebo,yF EO5a#a.util.0ate now7new 5a#a.util.0ate89: OF E61FEO7 now.get6ours89 OF:EO7now.getMinutes89OF:E O7now.get"econ,s89OFEG61F EGbo,yF EGhtmlF 1 ! & ' >t >t >t >t will will will will ,isplay ,isplay ,isplay ,isplay the ,ate as mm:,,:yy. the ,ate an, time. time as hhGmmGss. the current time as hh:mm:ss.

)orrect *ns: ' QuestionNo: JMT10<& Question What will be the output of the following co,e snippet: EOP page language7;5a#a;OF EhtmlF Ehea,FEGhea,F Ebo,yF EO5a#a.util.0ate now7new 5a#a.util.0ate89: OF E61FEO7 now OFEG61F EGbo,yFEGhtmlF 1 ! & ' >t >t >t >t will will will will ,isplay ,isplay ,isplay ,isplay the the the the ,ate time ,ate ,ate an, time. an, ,ay of the wee2. an, ,ay of the wee2. time an, ,ay of the wee2.

)orrect *ns: ' QuestionNo: JMT10<'

Question )onsi,er the following co,e: EOP page language7;5a#a;OF EhtmlF Ebo,yF EO "tring login78re%uest.get=arameter8;4ogin;99: "tring passwor,78re%uest.get=arameter8;=asswor,;99: for8int i70:iE10:iTT9 out.println8;4ogin is;T; ;Tlogin9: out.println8;=asswor, is;T; ;Tpasswor,9: OF EGbo,yF EGhtmlF What will be the output of the abo#e co,e if login name an, passwor, are accepte, through user interface? 1 4ogin message will be ,isplaye, ten times an, =asswor, message once. ! 3oth login an, passwor, message will be ,isplaye, ten times. & 4ogin Message will be ,isplaye, nine times an, =asswor, message once. ' 3oth login an, passwor, message will be ,isplaye, nine times. )orrect *ns: 1 QuestionNo: JMT10<? Question )onsi,er the usage of J"T4 forHach tag in the following co,e snippet: Efont color7@green@F EulF Ec:foreach flag7errmsg items7;UJerrorMsgsK;F EliFUerrmsgEGliF EGc:forHachF EGulF EGfontF

6owe#er the prece,ing co,e snippet contains some errors. =re,ict the correct co,e. 1 Efont color7@green@F EulF Ec:forHach #ar7errmsg items7;UJerrorMsgsK;F EliFUerrmsgEGliF EGc:forHachF EGulF EGfontF ! Efont color7@green@F EulF Ec:forHach #ar7;errmsg; items7;UJerrorMsgsK;F EliFUJerrmsgKEGliF EGc:forHachF EGulF EGfontF & Efont color7@green@F EulF Ec:forHach #ar7;errmsg; items7;UJerrorMsgsK;F EliFUerrmsgEGliF EGc:forHachF EGulF EGfontF ' Efont color7@green@F EulF Ec:forHach #ar7errmsg items7;UJerrorMsgsK;F EliFUJerrmsgKEGliF EGc:forHachF EGulF EGfontF )orrect *ns: ! QuestionNo: JMT10<A Question )onsi,er following statements for HBpression Tag in J"=: *9 *n HBpression tag can ta2e any 5a#a language eBpression that can be use, as an argument to "ystem.out.println. 39 HBpression tag is e#aluate, ,uring 6TT= $esponse.

)9 The $esult of the HBpression tag is inclu,e, in 6TT= re%uest stream. 09*fter H#aluation the #alue of HBpression tag has to be con#erte, to a "tring. Which of the following options is True with respect to the abo#e statements? 1 "tatement * 3 an, ) are true. ! "tatement * an, 0 are true. & "tatement 3 ) an, 0 are true. ' "tatement * 3 an, 0 are true. )orrect *ns: ! QuestionNo: JMT10<C Question )onsi,er the following co,e snippet of J"= 3ean: E5sp:usebean i,entity7;login; scope7;"ession; class7s1&1'.beans.4ogin3eanF EOV login.setIalue8re%uest.get=arameter8;4ogini,;99: login.set*,,ress8re%uest.get=arameter8;a,,ress;99: OF E5sp:usebeanF 6owe#er the prece,ing co,e contains errors. =re,ict the correct co,e. 1 E5sp:use3ean i,7;login; scope7;"ession; class7;s1&1'.beans.4ogin3ean;F EO login.setIalue8re%uest.get=arameter8;4ogini,;99: login.set*,,ress8re%uest.get=arameter8;a,,ress;99: OF EG5sp:use3eanF ! E5sp:use3ean i,entity7;login; scope7;"ession; class7;s1&1'.beans.4ogin3ean;F

EOV login.setIalue8re%uest.get=arameter8;4ogini,;99: login.set*,,ress8re%uest.get=arameter8;a,,ress;99: OF E5sp:use3eanF & E5sp:use3ean i,7;login; scope7;"ession; class7;s1&1'.beans.4ogin3ean;F login.setIalue8re%uest.get=arameter8;4ogini,;99: login.set*,,ress8re%uest.get=arameter8;a,,ress;99: EG5sp:use3eanF ' E5sp:use3ean i,7;login; scope7;"ession; class7;s1&1'.beans.4ogin3ean;F Elogin.setIalue8re%uest.get=arameter8;4ogini,;99:GF Elogin.set*,,ress8re%uest.get=arameter8;a,,ress;99:GF EG5sp:use3eanF )orrect *ns: 1 QuestionNo: JMT10<M Question While configuring the J"= Hn#ironment you want to turn off scripting as well as ignore H4 in the J"= file. What woul, be the co,e for this? 1 E5sp+configF E5sp+property+groupF Eurl+patternFGscriptting-offGDEGurl+patternF Escripting+in#ali,FtrueEGscripting+in#ali,F EG5sp+property+groupF E5sp+property+groupF Eurl+patternFGH4-offGDEGurl+patternF Eel+ignore,FtrueEGel+ignore,F EG5sp+property+groupF

EG5sp+configF ! E5sp+property+groupF Eurl+patternFGscriptting-offGDEGurl+patternF Escripting+in#ali,FtrueEGscripting+in#ali,F EG5sp+property+groupF E5sp+property+groupF Eurl+patternFGH4-offGDEGurl+patternF Eel-ignore,FtrueEGel-ignore,F EG5sp+property+groupF & E5sp+configF Eurl+patternFGscriptting-offGDEGurl+patternF Escripting+in#ali,FtrueEGscripting+in#ali,F Eurl+patternFGH4-offGDEGurl+patternF Eel-ignore,FtrueEGel-ignore,F EG5sp+configF ' E5sp+configF E5sp+property+groupF Eurl+patternFscriptting-offEGurl+patternF Escripting+in#ali,FtrueEGscripting+in#ali,F EG5sp+property+groupF E5sp+property+groupF Eurl+patternFH4-offEGurl+patternF Eel-ignore,FtrueEGel-ignore,F EG5sp+property+groupF EG5sp+configF F )orrect *ns: 1 QuestionNo: JMT10?1

Question Which metho, ,oes the ser#let *=> use to get the ser#let@s initialization parameters? 1 init=arameter ! get>nit & get>nit=arameter ' get=arameter )orrect *ns: & QuestionNo: JMT10?C Question Which of the following metho,s of the Qeneric"er#let abstract class ta2es re%uest an, response ob5ects as arguments? 1 init ! ser#ice & ,estroy ' get"er#let)onteBt )orrect *ns: ! QuestionNo: JMT10A! Question /nce the usage of the web component is o#er the web container remo#es the web component. Which metho, is calle, by the web container before it remo#es the instance of the web component? 1 ,elete ! remo#e & ser#ice ' ,estroy )orrect *ns: ' QuestionNo: JMT10AM Question Which of the following is the correct se%uence of life cycle of a ser#let? 1 init89

ser#ice89 ,estroy89 ! init89 start89 ,estroy89 & ser#ice89 init89 ,estroy89 ' start89 ser#ice89 ,estroy89 )orrect *ns: 1 QuestionNo: JMT10C! Question Which function of "er#let)onfig interface is use, to retrie#e ser#let initialization parameters? 1 get>nit=arameter89 ! get>nit=arameters89 & get>nitial=arameters89 ' get=arameters89 )orrect *ns: 1 QuestionNo: JMT10C? Question What is the syntaB of HBpression 4anguage in a J"= page? 1 UJeBprK ! WJeBprK & UJ;eBpr;K ' UXeBprY )orrect *ns: 1

QuestionNo: JMT10CA Question Which attribute of page ,irecti#e is use, for specifying the name of another 5sp page that will han,le all run time eBceptions? 1 err ! error=age & error-page ' runtimeerrorpage )orrect *ns: ! QuestionNo: JMT10CC Question Which attribute of page ,irecti#e is use, for specifying the superclass of ser#let class that is generate, from the 5sp page? 1 5sp:eBten,s ! implements & eBten,s ' 5speBten,s )orrect *ns: & QuestionNo: JMT10M0 Question Which metho, of 5sp is e%ui#alent to ser#ice metho, of ser#let? 1 -5sp"er#ice89 ! 5sp-"er#ice89 & 5sp"er#ice89 ' ser#ice89 )orrect *ns: 1 QuestionNo: JMT10M< Question "am is writing a web application program. 6e has implemente, "er#let)onteBt4istener interface in his web application program. Which metho, of "er#let)onteBt4istener interface he shoul, use to perform startup acti#ities for web application?

1 init89 ! initiate)onteBt89 & conteBt>nitialize,89 ' start89 )orrect *ns: & QuestionNo: JMT10M? Question "am is writing a web application program. 6e has implemente, "er#let)onteBt4istener interface in his web application program. Which metho, of "er#let)onteBt4istener >nterface he shoul, use to perform some cleanup acti#ities for web application? 1 ,estroy89 ! conteBt0estroy89 & close89 ' conteBt0estroye,89 )orrect *ns: ' QuestionNo: JMT10MM Question 4ist ,own the metho,s of "er#let)onteBt >nterface. 1 get>nit=arameter8name:"tring9:"tring get>nit=arameterNames89:Hnumeration get$esource8path9:1$4 get$esource*s"tream8path9:>nput"tream ! get>nit=arameter8name:"tring9:"tring get>nit=arameter4ist89:Hnumeration get$esource1rl8path9:1$4 get$esource*s"tream8path9:>nput"tream & get>nit=arameter89:"tring get>nit=arameter#alues89:Hnumeration get$esource8path9:1$4 get$esource*s"tream8path9:#oi, ' get>nit=arameter8name:"tring9:"tring get>nit=arameter4ist89:Hnumeration get$esource*s>nput"tream8path9:>nput"tream

)orrect *ns: 1 QuestionNo: JMT111? Question Margaret is ,e#eloping a Web application for a tra#el agency. "he creates a ser#let with the initialization parameter holi,ay-,estination. 3ase, on the #alues of the initialization parameter the ser#let ,isplays the rele#ant information. Margaret now wants to retrie#e the #alue of the initialization parameter. Which of the following co,e snippets helps retrie#e the initialization parameter successfully? 1 public #oi, ,oQet86ttp"er#let$e%uest re% 6ttp"er#let$esponse res9 throws "er#letHBception >/HBception J "tring strIalue7get>nit=arameter8;holi,ay-,estination;9: K ! public #oi, init89 throws "er#letHBception J "tring strIalue7get>nit=arameter8;holi,ay-,estination;9: K & public #oi, ,o=ost86ttp"er#let$e%uest re% 6ttp"er#let$esponse res9 throws "er#letHBception >/HBception J "tring strIalue7get>nit=arameter8;holi,ay-,estination;9: K ' public #oi, init89 throws "er#letHBception J "tring strIalue7re%uest.get>nit=arameter8;holi,ay-,estination;9: K )orrect *ns: ! QuestionNo: JMT111A Question "amantha is ,e#eloping an online boo2 store. "he creates a Ja#a3ean that accepts an, stores the boo2 preferences of a user in the array userpref. Now "amantha wants to ,e#elop a ser#let that retrie#es the boo2 preferences from the Ja#a3ean. Which of the following co,e snippets will help her retrie#e the thir, element of the userpref array? 1 UJparam.userprefX!YK ! UJparamIalues.userprefX&YK

& JparamIalues.userprefX!YK ' UJparamIalues.userprefX!YK )orrect *ns: ' QuestionNo: JMT100& Question Qeorge is ,e#eloping an application for an airline ser#ice. 0uring the ,e#elopment of the application he is face, with the problem of coupling between #iew an, controller components. >n a,,ition he fin,s that a lot of common infrastructure processing is being use, in the controllers of the application. 6e wants to a#oi, scripting the same co,e repeate,ly. Which of the following patterns will help Qeorge resol#e these problems? 1 Ialue /b5ect pattern ! MI) pattern & 0*/ pattern ' (ront )ontroller pattern )orrect *ns: ' QuestionNo: JMT100' Question Mar2 is ,e#eloping an application using the "truts MI) framewor2. 6e wants to configure the mappings between 1$4 patterns an, the controller classes. Which of the following options will help Mar2 in this tas2? 1 3ase classes ! The strutsconfig.Bml file & The *ction"er#let class ' The *ction class )orrect *ns: & QuestionNo: JMT100< Question Lou are creating an application using "truts framewor2. Now you ha#e to install the "truts library files. Lou want to install a library that pro#i,es ZM4 parsing utilities. Which of the following libraries will you install? 1 struts.5ar ! commons+beanutils.5ar

& commons+,igester.5ar ' struts.war )orrect *ns: & QuestionNo: JMT100? Question 4ean,er is ,e#eloping an application using the "truts framewor2. 6e has create, an action class that accepts name an, passwor, as input from the user. >f the passwor, contains eight characters a login+i, is create, an, ,isplaye, to the user. /therwise an error page nee,s to be ,isplaye,. Which of the following metho,s shoul, 4ean,er use to in#o2e the error page in case of an incorrect user input. 1 get$e%uest0ispatcher89 metho, ! fin,(orwar,89 metho, & forwar,89 metho, ' eBecute89 metho, )orrect *ns: ! QuestionNo: JMT100A Question "am is software ,e#eloper at 0ream"oft Technologies. 6is team is ,e#eloping a Web application for an institute which pro#i,es online classes to the engineering stu,ents. >n this Web application the team members ha#e create, three ser#ices "tu,ent"er#ice 3atch"er#ice an, 3atch*llocation"er#ice. The 3atch*llocation"er#ice interacts with the "tu,ent"er#ice an, 3atch"er#ice to allocate a batch to a stu,ent. 6owe#er the team members fin, that there is a tight coupling between the three ser#ices in the application. To re,uce coupling "am ,eci,es to use the "truts framewor2 in the application. *nalyze the scenario an, pre,ict whether "am will be able to re,uce coupling. >f not pro#i,e the solution. 1 No "am shoul, use the (a[a,e "er#ice in the application. ! Les "am will be able to re,uce coupling by using the "truts framewor2 in the application. & No "am shoul, use HJ3 in the application. ' No "am shoul, use entity ser#ice in the application. )orrect *ns: 1 QuestionNo: JMT100C

Question Mar2 is ,e#eloping a shopping site for Nucleus >nc. using the "truts framewor2. 6e has to write the co,e to trac2 the items that a user a,,s to the shopping cart. To implement this functionality he writes the following co,e in the *,,>tems*ction class: public class *,,>tems*ction eBten,s *ction J public *ction(orwar, eBecute8*ction(orm form 6ttp"er#let$e%uest re%uest 6ttp"er#let$esponse response9 J 4ist errorMsgs 7 new 4in2e,4ist89: re%uest.set*ttribute8;errorMsgs; errorMsgs9: try J "tring item"tr 7 re%uest.get=arameter8;>tem;9.trim89: "tring item)o,e 7 re%uest.get=arameter8;)o,e;9.trim89: .......... .......... K catch8HBception H9 J H.print"tac2Trace89 K K K 6owe#er the prece,ing co,e causes errors ,uring compilation. *nalyze the prece,ing co,e to i,entify the cause of error an, pro#i,e the solution. 1 The set*ttribute89 metho, is use, incorrectly in the co,e. The correct co,e is: response.set*ttribute8;errorMsgs; errorMsgs9:

! The set*ttribute89 metho, is use, incorrectly in the co,e. The correct co,e is: re%uest.set*ttribute8errorMsgs ;errorMsgs;9: & The incorrect signature of the eBecute89 metho, is use, in the co,e. The correct signature is: public *ction(orwar, eBecute8*ctionMapping mapping *ction(orm form 6ttp"er#let$esponse response9 ' The incorrect signature of the eBecute89 metho, is use, in the co,e. The correct signature is: public *ction(orwar, eBecute8*ctionMapping mapping *ction(orm form 6ttp"er#let$e%uest re%uest 6ttp"er#let$esponse response9 )orrect *ns: ' QuestionNo: JMT100M Question Jenny has been assigne, the tas2 to ,e#elop a login mo,ule of a Web application that authenticates the users an, pro#i,es success an, failure messages ,epen,ing upon the user cre,entials. The two types of users of the Web application are pro#i,er an, consumer. *s the Web application has been ,e#elope, using the "truts framewor2 Jenny creates two action classes to #ali,ate the users. The Iali,ate=ro#i,e*ction class #ali,ates the users who log in as pro#i,er. 6owe#er the Iali,ate)onsumer*ction class the users who log in as consumer. "he stores the two action classes in the #ali,ate pac2age of the application. *fter creating the action classes she writes the following co,e in the struts+ config.Bml file to configure the action classes: Eaction+mappingsF Eaction path7;G"truts*ppGform; type7;GIali,ate=ro#i,e*ction;F Eforwar, name7;success; path7;GwebpageGsuccess.#iew;GF Eforwar, name7;error; path7;GwebpageGerror.#iew;GF EGactionF Eaction path7;G"truts*ppGform; type7;GIali,ate)onsumer*ction;F Eforwar, name7;success; path7;GwebpageGsuccess.#iew;GF Eforwar, name7;error; path7;GwebpageGerror.#iew;GF EGactionF

EGaction+mappingsF 6owe#er Jenny is not able to perform the ,esire, tas2 with the prece,ing mapping. >,entify the correct co,e that Jenny can use to perform the ,esire, tas2. 1 Eaction+mappingsF Eaction path7;G"tuts*ppGform; type7;#ali,ate.Iali,ate=ro#i,e*ction;F Eforwar, name7;success; path7;GwebpageGsuccess.#iew;GF Eforwar, name7;error; path7;GwebpageGerror.#iew;GF EGactionF Eaction path7;G"truts*ppGform; type7; #ali,ate.Iali,ate)onsumer*ction ;F Eforwar, name7;success; path7;GwebpageGsuccess.#iew;GF Eforwar, name7;error; path7;GwebpageGerror.#iew;GF EGactionF EGaction+mappingsF ! Eaction+mappingsF Eaction path7;G"tuts*ppGform; type7;#ali,ateGIali,ate=ro#i,e*ction;F Eforwar, name7;success; path7;GwebpageGsuccess.#iew;GF Eforwar, name7;error; path7;GwebpageGerror.#iew;GF EGactionF Eaction path7;G"truts*ppGform; type7; #ali,ateGIali,ate)onsumer*ction ;F Eforwar, name7;success; path7;GwebpageGsuccess.#iew;GF Eforwar, name7;error; path7;GwebpageGerror.#iew;GF EGactionF EGaction+mappingsF & Eaction+mappingsF Eaction path7;G"tuts*ppGform; type7;G#ali,ateGIali,ate=ro#i,e*ction;F Eforwar, name7;success; path7;GwebpageGsuccess.#iew;GF Eforwar, name7;error; path7;GwebpageGerror.#iew;GF EGactionF Eaction path7;G"truts*ppGform; type7; G#ali,ateGIali,ate)onsumer*ction ;F Eforwar, name7;success; path7;GwebpageGsuccess.#iew;GF Eforwar, name7;error; path7;GwebpageGerror.#iew;GF EGactionF EGaction+mappingsF ' Eaction+mappingsF Eaction path7;G"tuts*ppGform; type7#ali,ate.Iali,ate=ro#i,e*ctionF Eforwar, name7;success; path7;GwebpageGsuccess.#iew;GF Eforwar, name7;error; path7;GwebpageGerror.#iew;GF EGactionF

Eaction path7;G"truts*ppGform; type7 #ali,ate.Iali,ate)onsumer*ction F Eforwar, name7;success; path7;GwebpageGsuccess.#iew;GF Eforwar, name7;error; path7;GwebpageGerror.#iew;GF EGactionF EGaction+mappingsF )orrect *ns: 1 QuestionNo: JMT1010 Question $obin is ,e#eloping a Web application by using the "truts framewor2. 6e stores the application in a fol,er name, "truts*pp. Moreo#er he creates the lib fol,er in the "truts*pp fol,er an, stores the struts.5ar commons+beanutils.5ar an, commons+,igester.5ar files in the lib fol,er. 6owe#er he is not able to eBecute the application successfully. >,entify the problem an, pro#i,e the solution. 1 $obin shoul, mo#e the lib fol,er to the src fol,er of the application. ! $obin shoul, mo#e the lib fol,er to the web fol,er of the application. & $obin shoul, mo#e the lib fol,er to the WH3+>N( fol,er of the application. ' $obin shoul, mo#e the lib fol,er to the classes fol,er of the application. )orrect *ns: & QuestionNo: JMT10&? Question Lou ha#e been assigne, the tas2 of ,esigning the web application for the 4ibrary of your organization. The web application is ,i#i,e, into three components: 3oun,ary "er#ice an, Hntity. Lou are re%uire, to re,uce the coupling between the boun,ary components an, other ser#ices while ,esigning the communication between them in the web application. 6ow will you perform this tas2? 1 3y using the Hntity relate, ser#ices. ! 3y using the (aca,e ser#ice. & 3y using 0omain Hntities. ' 3y using the *nalysis mo,el. )orrect *ns: ! QuestionNo: JMT10&A

Question Lou are ,e#eloping a web application for the soccer league using "truts framewor2. (or this you nee, to create a "truts controller that eBten,s the "truts *ction base class an, implements the eBecute metho,. 6ow will you ,eclare the eBecute metho, in the "truts controller class? 1 public *ction(orwar, eBecute8*ctionMapping mapping *ction(orm form 6ttp"er#let$e%uest re%uest 6ttp"er#let$esponse response9 J GGwrite the co,e K ! public #oi, eBecute8*ctionMapping mapping *ction(orm form 6ttp"er#let$e%uest re%uest 6ttp"er#let$esponse response9 J GGwrite the co,e K & public int eBecute8*ctionMapping mapping 6ttp"er#let$e%uest re%uest 6ttp"er#let$esponse response9 J GGwrite the co,e K ' public *ction(orwar, eBecute8*ction(orm form 6ttp"er#let$e%uest re%uest 6ttp"er#let$esponse response9 J GGwrite the co,e K )orrect *ns: 1 QuestionNo: JMT10&C Question Lou are ,e#eloping a web application for the soccer league using ser#lets. Lou ,eci,e, to use the "truts framewor2 to ,e#elop the web application. (or this you nee, to create a "truts controller. 6ow will you create the "truts controller class? 1 3y eBten,ing the "truts *ction class

! 3y eBten,ing the "truts *ction(orwar, class & 3y eBten,ing the "truts *ctionMapping class ' 3y eBten,ing the "truts *ction(orm class )orrect *ns: 1 QuestionNo: JMT10&M Question Lou are ,e#eloping a web application using "er#lets. Lou ,eci,e to use "truts framewor2 to ,e#elop the web application. (or this you are re%uire, to first configure the "truts >nfrastructure )ontroller. What will you ,o to configure the "truts >nfrastructure )ontroller? 1 )onfigure the action mappings. ! >nstall the "truts library files. & )onfigure the "truts *ction"er#let in the ,eployment ,escriptor file. ' )onfigure application+specific classes. )orrect *ns: & QuestionNo: JMT10C0 Question Which component is use, for implementing communication between the entity an, boun,ary component? 1 ser#ice ! #iew & controller ' eBternal entity )orrect *ns: 1 QuestionNo: JMT10C1 Question Which pac2age is use, for implementing struts framewor2 in a program? 1 org.apache.strutsframewor2.action ! org.apache.struts.action & org.apache

' org.apach-struts )orrect *ns: ! QuestionNo: JMT10CM Question The return type of the eBecute metho, in struts framewor2 is -----------. 1 *ction(orm ! *ction(orwar, & *ctionMapping ' *ction )orrect *ns: ! QuestionNo: JMT10M! Question What is the primary "truts (ramewor2 4ibrary file? 1 struts.5ar ! struts-lib.5ar & strutslib.5ar ' struts-primary.5ar )orrect *ns: 1

You might also like