The document contains a series of multiple-choice questions and answers related to JSP (JavaServer Pages) and J2EE technology, covering various concepts such as session scope, JSP scripting, EJB handles, JDBC, and request dispatching. It addresses the advantages of XML for data transfer, the differentiation between servlets and JSP, and the significance of request scope in managing objects. Additionally, it includes questions on HTTP methods, dynamic web content generation, and cloud computing security standards.
1. Which optionis true about session
scope?
◦ A. Objects are accessible only from the page in which they are created
◦ B. Objects are accessible only from the pages which are in same session
◦ C. Objects are accessible only from the pages which are processing the same
request
◦ D. Objects are accessible only from the pages which reside in same
application
◦ Answer: B
3.
2. Which ofthe scripting of JSP not putting
content into service method of the
converted servlet?
◦A. Declarations
◦B. Scriptlets
◦C. Expressions
◦D. None of the above
◦ Answer: C
4.
3. Why isXML a good way to transfer text-
based data from one program or tool to
another?
◦ A. XML imposes important limitations on the receiving program or
tool
◦ B. The receiving program or tool can use the XML tagging
information to determine how to best handle the incoming data
◦ C. XML tags offer an extra level of security
◦ D. XML tags specify to the receiving program or tool exactly how to
format and display the data
◦ Answer: B
5.
4. The methodforward(request,
response) will
◦ A. return back to the same method from where the forward was
invoked
◦ B. not return back to the same method from where the forward was
invoked and the web pages navigation continues
◦ C. Both A and B are correct
◦ D. None of the above
◦ Answer: A
6.
5. The differencebetween Servlets
and JSP is the …………….
◦A. translation
◦B. compilation
◦C. syntax
◦D. Both A and B
◦ Answer: C
7.
6. Which ofthe following are the valid
scopes in JSP?
◦A. request, page, session, application
◦B. request, page, session, global
◦C. response, page, session, application
◦D. request, page, context, application
◦ Answer: A
8.
7. JSP includesa mechanism for
defining ……………. or custom tags.
◦A. static attributes
◦B. local attributes
◦C. dynamic attributes
◦D. global attributes
◦ Answer: C
9.
8. Which describesbest an EJB
handle?
◦ A. An EJB handle is used to handle exceptions when accessing EJB
objects
◦ B. An EJB handle is used to store a reference to a specific EJB object
◦ C. An EJB handle is part of the Home interface
◦ D. An EJB handle is used for local references inside the EJB container
◦ Answer: B
10.
9. Why DBconnections are not
written directly in JSPs?
◦A. Response is slow
◦B. Not a standard J2EE architecture
◦C. Load Balancing is not possible
◦D. Both B and C
◦ Answer: D
11.
10. How manyjsp implicit objects are there
and these objects are created by the web
container that are available to all the jsp
pages?
◦A. 8
◦B. 9
◦C. 10
◦D. 7
◦ Answer: B
12.
11. Why useRequest Dispatcher to forward a
request to another resource, instead of using a
sendRedirect?
◦ A. Redirects are no longer supported in the current servlet API
◦ B. Redirects are not a cross-platform portable mechanism
◦ C. The RequestDispatcher does not use the reflection API
◦ D. The RequestDispatcher does not require a round trip to the client, and
thus is more efficient and allows the server to maintain request state
◦ Answer: D
13.
12. Which isnot a directive?
◦A. include
◦B. page
◦C. export
◦D. useBean
◦ Answer: C
14.
13. Which attributespecifies a JSP page that should
process any exceptions thrown but not caught in the
current page?
◦A. The ErrorPage Attribute
◦B. The IsErrorPage Attribute
◦C. Both A & B
◦D. None of the above
◦ Answer: A
15.
14. Which httpmethod send by browser that
asks the server to get the page only?
◦A. get
◦B. post
◦C. option
◦D. put
◦ Answer: A
16.
15. JDBC isa ……… interface, which means that it is
used to invoke SQL commands directly
◦A. low-level
◦B. middle-level
◦C. higher-level
◦D. user
◦ Answer: A
17.
16. Which cangenerate HTML dynamically on the client but
can hardly interact with the web server to perform complex
tasks like database access and image processing etc. in JSP?
◦A. vs.Static HTML
◦B. vs.Server-Side Includes
◦C. vs.Pure Servlets
◦D. Vs.JavaScript
◦ Answer: D
18.
17. What isJDBC?
◦A. java compiler
◦B. Java API
◦C. Java interpreter
◦D. Both A and B
◦ Answer: B
19.
18. Dynamic interceptionof requests and
responses to transform the information is
done by
◦A. servlet container
◦B. servlet config
◦C. servlet context
◦D. servlet filter
◦ Answer: D
20.
19. What typeof scriptlet code is better-suited to
being factored forward into a servlet?
◦A. Code that deals with logic that is common across
requests
◦B. Code that deals with logic that is vendor specific
◦C. Code that deals with logic that relates to database
access
◦D. Code that deals with logic that relates to client scope
◦ Answer: A
21.
20. This isa software distribution model in which applications
are hosted by a vendor or service provider and made available
to customers over a network, typically the Internet.
◦A. Platform as a Service (PaaS)
◦B. Infrastructure as a Service (IaaS)
◦C. Software as a Service (SaaS)
◦D. None
◦ Answer: C
22.
21. What isthe initial contact point for
handling a web request in a Page-Centric
architecture?
◦A. A JSP page
◦B. A JavaBean
◦C. A servlet
◦D. A session manager
◦ Answer: A
23.
22. Java Softprovides ……... JDBC product
components as part of the java Developer’s Kit
(JDK)
◦A. three
◦B. two
◦C. four
◦D. single
◦ Answer: A
24.
23. How tosend data in get method?
◦A. We can't
◦B. Through url
◦C. Through payload
◦D. None of these
◦ Answer: B
25.
24. What isthe name of the organization
helping to foster security standards for cloud
computing?
◦A. Cloud Security Standards Working
◦B. Cloud Security Alliance
◦C. Cloud Security Watchdog
◦D. Security in the Cloud Alliance
◦ Answer: B
26.
25. Which ofthe following statements is true
regarding the scope of 'request' in JSP?
◦ A. Objects with request scope are accessible from pages processing the same
request where they were created
◦ B. All references to the object shall be released after the request is processed; in
particular, if the request is forwarded to a resource in the same run time, the
object is still reachable
◦ C. References to objects with request scope are stored in the request object
◦ D. All of the above
◦ Answer: D