You are on page 1of 10

1.

Place the events in the order they occur

Ans :

1st 2nd 3rd 4th 5th !th $th

------------> ------------> ------------> ------------> ------------> ------------> ------------>

JSP page is translated JSP page is compiled JSP page implementation class is loaded JSP page implementation is instantiated Jsp nit is called "#stService is called #st%estroy is called

2& Place the code snippets in the proper order to construct the JSP code to import static content into a JSP page at translation-time&

Ans : <% include file = foo.jsp %>

3& Place the appropriate element names on the le't on the (e) application deployment descriptor on the right so that 'iles ending in *&mpg* are associated (ith the + +, type *video-mpeg&*

Ans : < mine-mapping > < extension > mpg </ extension > < mime-type > video-mpeg </ mime-type > < mime-mapping >

4& A servlet conte.t listener loads a list o' com&e.ample&Product o)#ects 'rom a data)ase and stores that list into the catalog attri)ute o' the Servlet/onte.t o)#ect& Place code snippets to construct a #sp:use0ean standard action to access this catalog&

Ans : id 1 2catalog3 type 1 2com&e.ample&product3 scope 1 2application3

5& Place the corresponding resources and directories in the proper (e) application deployment structure

Ans : """"" 4"""JSP 'iles Static content 4 4"""5,0- 67 4 4"""classes 4 4"""" #ava and servlet classes 4 4"""" li) 4 4"""" JA8 'iles 4 4"""" (e)&.ml

!& Place the events in the order they occur&

Ans : 1st 2nd 3rd 4th 5th ----------> ----------> ----------> ----------> ----------> (e) container loads the servlet class (e) container instantiates the servlet (e) container calls the servlet3s init9: +ethod (e) container calls the servlet3s service9: +ethod (e) container calls the servlet3s destroy9: +ethod

$& ;iven a re<uest 'rom my)o.&e.ample&com= (ith an P address o' 1>&>&1&11 on port 33>?!= place the appropriate Servlet8e<uest methods onto their corresponding return values&

Ans : +y)o.&e.ample&com 1>&>&1&11 33>?! ---------> ----------> ----------> get 8emote@ost get 8emote@ost get ServerPort

?& Place the code snippets in the proper order to construct the JSP code to include dynamic content into a JSP page at re<uest-time&

Ans :

< jsp : include

page = foo.jsp

/>

A& Place the servlet name onto every re<uest B8C= relative to the (e) application conte.t root= that (ill invoDe that servlet& ,very re<uest B8C must )e 'illed&

Ans : -data-data-inde.&#sp -----------> -----------> %ataServlet %ataServlet /ontrolServlet %ataServlet /ontrolServlet

-secure-command&do -----------> -data-command&do -data&do -----------> ----------->

1>& Place the E+C elements in the (e) application deployment descriptor solution to con'igure a servlet conte.t event listener named com&e.ample&+yCistener&

Ans : < listener > < listener-class > com&e.ample&+yCistener </ listener-class > < listener >

You might also like