Documentos de Académico
Documentos de Profesional
Documentos de Cultura
2. Which of the following code snippets refers to the JSP element type EL
expression?
a. <%@ page import=java.util.*%>
b. <%! Int a=22;%>
c. <% Float obj = new Float (22.13); %>
d. ${requestScope.customer.name}
4. Which of the following is not the attribute taken by the Action Tag in the struts
configuration file?
a. invalidate
b. scope
c. validate
d. name
getInitParameter(name:String):String
getlnitParameter():String
rce(path):URL
c.
getlnitParameterList():Enumeration
getResourceAslnputstream(path):Inputstream
getlnitParameter(name:String):String
d.
getlnitParameterList():Enurneration
getResourceUrl(path):URL
getResourceAsStream(path): InputStream
getlnitParameter(name:String):String
8. Which of the following options refers to the portable file used to define a web
service interface?
a. Port
b. SOAP
c. Service
d. WSDL
9. You are developing a web application using Servlets. You have to use filters so
that the web container intercepts the incoming requests before it is forwarded to
the servlet. Which of the following method of the filter is passed a FilterConfig
object and is used to perform onetime initialization tasks?
a. doFilter
b. destroy
c. doGet
d. init
10. Which of the following is NOT a method of the Genericservlet abstract class?
a. getlnitParameterNames
b. doPost
c. getlnitParameter
d. init
11. Which method can be used for adding cookies to the response object?
a. addcookie()
b. addcookies()
c. add()
d. addCookieList()
a. getOutputStream
b. setContentType
c. getWriter
d. setAttribute
13. You want that the browser should issue a GET request when it submits a form
with a definition in HTML. Identify the correct code snippet that you will use so
that the browser can perform the desired task?
a. <FORM ACTION = formtest TYPE=GET>
b. <FORM ACTION = form_test METHOD=GET>
c. <FORM ACTION = form_test VALUE=GET>
d. <FORM ACTION = form_test NAME=GET>
14. Which attribute of page directive is used for specifying the name of another
jsp page that will handle all run time exceptions?
a. err
b. runtimeerrorpage
c. error_page
d. errorPage
16. You are creating a Web application. For this, you have to define various job
roles in your Web application team. One of the job roles requires creating
Controller elements, which consist mostly of servlets. Identify the job role?
a. Web Designer
17. Mark is developing a web based application. The home page is a servlet that
accepts the user name and password. Mark does not want the user to enter the
username every time he logs into the website. He wants to find a way to store
the value on the users machine. Which method should he use so that the value
gets stored on the users machine?
a. addSession
b. addCookie
c. getSession
d. getCookie
18. You are creating a web application using Servlets. This web application needs
to be integrated with the database. For this, you are required to manage the
database communication. You decide to keep only a few connections that are
shared among data access logic elements. What do you call this type of database
communication?
a. Connection Pooling
b. DAO
c. DataSource
d. JDBC API
21. While creating a synchronous queue consumer, you want to provide the API
to receive messages from the queue destination. Which of the following object
will you create to perform the preceding task?
a. Session
b. TextMessage
c. QueueReceiver
d. QueueSender
24. Which of the following programs runs in a separate thread in the Web
container for each client request?
a. Servlets
b. Pearl
c. CCI
d. HTML
25. Which of the following protocol is used for message transport in JAXWS?
a. HTTP
b. TCP/IP
c. IIOP
d. UDDI
26. You are developing a web application for the soccer league using servlets.
You decided to use the Struts framework to develop the web application. For
this, you need to create a Struts controller. How will you create the Struts
controller class?
a. By extending the Struts ActionForward class
b. By extending the Struts Action Form class
c. By extending the Struts ActionMapping class
c. By extending the Struts Action class
c. struts_lib.jar
d. struts.jar
28. Which of the following Java EE patterns is a business tier pattern that
exposes the business functions that are implemented as coarse g rained
services by the business logic components of the EJB tier?
a. Service Locator
b. View Helper
c. Data Access Object
d. Session Facade
29. You want to change the entity lifecycle state from managed to removed.
Which of the following operation you will implement to perform the preceding
task?
a. Use the entity managers remove operation.
b. Use the new operator to create a new instance.
c. Use the entity managers persist operation.
d. Lose the reference to the removed instance.
30. You, being a software developer, needs to develop a web application for your
organization. You decided to use servlets to create the web application. After you
have created the servlet, you now need to clean up the resources that your
servlet has initialized. How will you perform this task?
a. By overriding the service method in the servlet class.
b. By overriding the mit method in the servlet class.
c. By overriding the doCet method in the servlet class.
d. By overriding the destroy method in the servlet class.
b. service
c. doGet
d. doPost
32. Which of the following files contains the deployment information for one or
more enterprise beans?
a. persistence.xml
b. web.xml
c. ejb-jar.xml
d. application.xml
34. Which of the following is NOT a component of the client request required to
be processed by a servlet?
a. The Additional information included in a query string
b. The URL of the document requested by the client
c. The communication protocol
d. The CCI Script
35. Which of the following code snippets refers to the JSP element type
expression?
a. <% Float obj = new Float (22.13); %>
b. <%= acct.getBalance()%>
36. You want to control the containers behavior in such a way that if the caller
does not have a transaction, the method does not run in a transaction.
Which of the following transaction attributes you will use to perform the
preceding task.
a. Supports
b. Mandatory
c. RequiresNew
d. Required
37. Assertion: A change made to any code requires recompilation of the servIet.
Reason: Servlets tie up files (an HTML file for the static content and a Java file
for the dynamic content) to independently handle the static presentation logic
and the dynamic business logic.
Which of the following options is correct with respect to the assertion and reason
given above?
a. The assertion is TRUE but the reason is a FALSE statement.
b. BOTH the assertion and reason are TRUE statements, but the reason IS NOT a
correct explanation of the assertion.
c. BOTH the assertion and reason are TRUE statements and the reason IS the
correct explanation of the assertion.
d. The assertion is FALSE hence the reason DOES NOT apply.
38. Which of the following XML data types maps with the Java data type
byte[]?
a. xsd:unsignedlnt
b. xsd:hexBinary
c. xsd:QName
d. xsd:NOTATION
39. You, being a software developer, needs to develop a web application for your
organization. You decided to use servlets to create the web application. While
you are creating the servlet, you feel the need to write the code for the
initialization of the servlet. This is needed to initialize the servlet with the
required data after the servlet instance has been created. How will you perform
this task?
a. By overriding the destroy method in the servlet class.
b. By overriding the mit method in the servlet class.
c. By overriding the docet method in the servlet class.
d. By overriding the service method in the servlet class.
40. Which method does the serviet API use to get the servIet initialization
parameters?
a. getlnit
b. getlnitParameter
c. initParameter
d. getParameter
41. You are developing a web application using Servlets. You have to use filters
so that the web container intercepts the incoming requests before it is forwarded
to the servlet. Which of the following method of the filter is passed a FilterConfig
object and is used to perform onetime initialization tasks?
a. destroy
b. doGet
c. doFilter
d. init
43. Which of the following options monitors a message queue for message
driven beans on behalf of the EJB component?
a. Model
b. Container
c. Client
d. Proxy
45. Which of the following options does not refers to the requirements for a
Session Bean class?
a. The class must be a toplevel class.
b. The class must define the finalize method.
c. The class must be defined as public.
d. The class must define a public constructor that takes no parameters.
46. You are working on an application that has multiple components. The control
needs to be transferred from one component to another component. The
invoking component should not be able to produce any output of its own. Which
method from the RequestDispatcher interface can be used to perform the task?
a. request
b. include
c. response
d. forward
50. Which method of Filter interface is used to decide whether to call the next
component in the filter chain or incoming request has to be blocked?
a. service()
b. doFilter()
c. execute()
d. init()
53. Which of the following Java EE patterns is a presentation tier pattern for a
component that provides ancillary functions?
a. Service Locator
b. Session Facade
c. View Helper
d. Data Access Object(DAO)
54. You want to change the entity lifecycle state from managed to removed.
Which of the following operation you will implement to perform the preceding
task?
a. Use the new operator to create a new instance.
b. Use the entity managers remove operation.
56. While creating a message queue producer, you want to send one or more
Message objects. Which of the following object will you use to perform the
preceding task?
a. TextMessage
b. QueueReceiver
c. Session
d. QueueSender
60. You are creating a web application using Servlets. This web application needs
to be integrated with the database. For this, you are required to create a
datasource. This datasource will be used by the components to retrieve a
connection. Which of the following method is called by the component on the
DataSource to retrieve a database connection?
a. close
b. prepareStatement
c. lookup
d. getConnection