Está en la página 1de 16

1. Which of the following is a custom tag in a jsp page?

a. XML tag representing some dynamic action.


b. XML tag representing some static action.
c. HTML tag representing some dynamic action.
d. HTML tag representing some static action.

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}

3. Which of the following is incorrect in reference to Topic destination?


a. It implements the pointtopoint messaging protocol.
b. It implements the pubIish/subscribe messaging protocol.
c. There is a timing dependency between publishers and subscribers.
d. It is based on the concept of a message object.

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

5. Which of the following is correct in reference to Location transparency?

a. It means that in any componenttocomponent interaction, the calling


component is not concerned with the physical location of the target component.
b. It is responsible for the deployment of the assembled application in a specific
operational environment.
c. It is defined by J2EE specification as the packaging format for EJB components
and J2EE clients.
d. It is a feature of the component that can be either read and written by its clients
or read or written by its clients.

6. Which of the following methods is exposed by the HttpServletRequest


interface?
a. addCookie
b. getOutputstream
c. getUserPrincipal
d. getWriter

7. List Down the methods of ServletContext Interface.


a.
getlnitParameterNames():Enumeration
getResource(path):URL
getResourceAsstream(path): Inputstream
b.
getlnitParametervalues():Enumeration
getResou
getResourceAsstream(path):void

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()

12. Which of the following methods is exposed by the ServletRequest interface?

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

15. Which of the following is a function performed by the include directive?


a. Provides the file names to be inserted in the JSP page at translation time.
b. Provides the classes to be inserted in the JSP page at translation time.
c. Provides the file names to be inserted in the JSP page at design time.
d. Provides the classes to be inserted in the iSP page at design time.

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

b. Business Component Developer


c. Data Access Developer
d. Web Component Developer

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

19. Sam is writing a web application program. He has implemented


ServletContextListener interface in his web application program. Which method
of ServletContext Interface he should use to perform startup activities for web
application?
a. init()
b. contextInitialized()
c. initiateContext()
d. start()

20. Darren Hayes, a developer, needs to create an application in EJB. The


application needs to accept the data from the user and perform calculations on
data. After calculating, the data needs to be stored in the database. Darren wants
to design a portable application, which is not rigidly tied with the database.
Which type of enterprise beans should be used to store data?
a. Stateless Session Bean
b. Stateful Session Bean
c. Entity Beans
d. Messagedriven beans

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

22. Consider the following code snippet for an error page:


<%=exception %>
Which of the following code snippets can be used to specify the page as an error
page?
a. <%@ErrorPage =true%>
b. <%@ page isErrorPage=true%>
c. <%@ page errorPage=true96>
d. <%@ page errorPage=errorpage.jsp%>

23. Which of the following refers to message type StreamMessage?


a. A java.lang.String object.

b. A stream of uninterpreted bytes or binary data.


c. A serializable Java technology object.
d. A stream of Java technology primitive values filled and read sequentially.

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

27. What is the primary Struts Framework Library file?


a. struts_primary.jar
b. strutslib.jar

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.

31. Which method of the HttpServlet class is implemented to filter incoming


requests by type?
a. doPut

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

33. Which of the following is incorrect in reference to Asynchronous component


interaction?
a. It accommodates the operations that take an extended time to complete.
b. It reduces coupling between components.
c. It is used for communication between a web browser and web component over
HTTP.
d. It uses requestnotification semantics.

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()%>

c. <% page import=java.util.*%>


d. <%! Int a=22;%>

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

42. Which of the following options refers to message type BytesMessage


a. A java.lang.String object.
b. A set of namevalue pairs.

c. A stream of Java technology primitive values filled and read sequentially.


d. A stream of uninterpreted bytes or binary data.

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

44. HttpServletRequest is a sub interface of:


a. HttpServlet
b. HttpRequest
c. ServletRequest
d.It is not a subinterface

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

47. Which method returns an enumeration of string composed of the names of


each header in the request stream?
a. getHeaderName()
b. getHeaderlnfo()
c. getHeader()
d. getHeaderNames()

48. Sam is writing a web application program. He has implemented


ServletContextListener interface in his web application program. Which method
of ServletContext Interface he should use to perform startup activities for web
application?
a. start()
b. contextlnitialized()
c. init()
d. initiateContext()

49. Consider the following code snippet for an error page:


<%=exception %>
Which of the following code snippets can be used to specify the page as an error
page?
a. <%@ page errorPage=true%>
b. <%@ErrorPage=true%>
c. <%@ page isErrorPage=true%>
d. <%@ page errorPage=errorpage.jsp%>

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()

51. In a Serviceto-Worker and Dispatcher View patterns, which of the following


options render the data into the format required by the browser?
a. Controller servlet
b. Web browser
c. View elements
d. Model elements

52. What is the primary Struts Framework Library file?


a. struts_primary.jar
b. struts.jar
c. strutslib.jar
d. struts_lib.jar

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.

c. Use the entity managers persist operation.


d. Lose the reference to the removed instance.

55. Object relational mapping metadata is a Persistence Unit component?


Which of the following is correct in reference to the default location of Object
relational mapping metadata?
a. These are placed in a persistence provider specific location.
b. It is located in the METAINF directory off the root of the EJBJAR file.
c. Its default configuration information is known to the Java EE application server.
d. These are included as annotations in the entity classes. An alternative default
location is the XML deployment descriptor file.

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

57. Which of the following is correct in reference to Location transparency?


a. It means that in any componenttocomponent interaction, the calling
component is not concerned with the physical location of the target component.
b. It is defined by J2EE specification as the packaging format for EJB components
and J2EE clients.
c. It is a feature of the component that can be either read and written by its clients
or read or written by its clients.
d. It is responsible for the deployment of the assembled application in a specific
operational environment.

58. Which of the following is NOT TRUE for the servlet?

a. Each request in servlet runs in separate thread.


b. Servlets are robust and object oriented.
c. Servlets are Platform Independent.
d. Servlets always handles Concurrency issues.

59. Which of the following methods is exposed by the HttpservletRequest


interface?
a. addCookie
b. getOutputstream
c. getUserPrincipal
d. getWriter

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

También podría gustarte