0% found this document useful (0 votes)
135 views12 pages

JSP MCQs - Final1

The document contains questions about Java EE technologies including Java Servlets, JSP, JSF, Hibernate and more. Some key points: - Container-managed and bean-managed persistence are used to make EJBs persistent to data storage. - The <c:out> tag outputs encoded values to avoid scripting attacks. - The implicit object httpSession represents the user's session. - Servlets throw IOException and ServletException from the service() method. - Hibernate simplifies interacting with databases using object-relational mapping. - The taglib directive points to the location of custom tag files.

Uploaded by

unstable da
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
135 views12 pages

JSP MCQs - Final1

The document contains questions about Java EE technologies including Java Servlets, JSP, JSF, Hibernate and more. Some key points: - Container-managed and bean-managed persistence are used to make EJBs persistent to data storage. - The <c:out> tag outputs encoded values to avoid scripting attacks. - The implicit object httpSession represents the user's session. - Servlets throw IOException and ServletException from the service() method. - Hibernate simplifies interacting with databases using object-relational mapping. - The taglib directive points to the location of custom tag files.

Uploaded by

unstable da
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 12

1.

Which of the followings two mechanisms are used to make EJB persistence
to the data storage?
a) Container-managed persistence
b) Object-model persistence
c) Bean-managed persistence
d) A &C

2. Which one is equal output to The &ltc:out & gt;Action


a. ${}
b. getmethod of bean
c. <%=%>
d. Above a & c

3. What is the implicit that is one of type HttpSession?


a. Application
b. httpSession
c. httpsession
d. Session

4. In servlet the service() throws the following


a. IOException, ServletException
b. HTTPexception
c. ArrayOutOfboundException
d. NullPointerException

5. Hibernate is used to simplify to interact with the database


a. True
b. False

6. What directive do we use to point to the location of the tag file?


a. Tag
b. Page
c. Taglib
d. Tagfile

7. In JEE what happened when web container execute JSP?


a. jsp to Servlert code
b. jsp to HTML
c. implementation servlet
d. above a & c

8. Which of the following configuration file control flows through the


application in JSF?
a. Web.xml
b. Faces-config.xml
c. None

9. When we configure a JavaBean which of the following scopes are


required(choose all that are applicable)
a. Page
b. Request
c. Session
d. Application
e. All of the above
[

10. DoGet(), doPost(), doHead(), doDelete() belongs to what type of servlet?


a. HttpServlets
b. GenericServlet
c. All of the above
d. None of the above

11. Config is object of which class?


a. javax.servlet.Context
b. javax.servlet.ServletContext
c. javax.servlet.ServletConfig
d. javax.servlet.Application
12. In which two web application directories can dependent classes and
libraries be located?
a. /WEB-INF/lib as a JAR file
b. /WEB-INF/lib as compiled class file
c. /WEB-INF/classes as compiled class file
d. /META-INF/classes as compiled class files
e. Above a & c

13. When using servlet, we use log method for


a. Application log
b. Web server log
c. Jsp log
d. Application server

14. Where you put JSTL lib on the web application?


a. WEB-INF/lib
b. Lib
c. Root/lib on container home path

15. What type of programming in JSP?


a. Server
b. Client

16. When the web container cannot find a file requested in the web
application, it will show the status code.
a. 408
b. 500
c. 404
d. 504

17. Which security mechanism uses the concept of a realm?


a. Authorization
b. Data integrity
c. Confidentiality
d. Authentication
18. <%=new java.util.Date()%> is the example of –
a. Declaration
b. ELException
c. Expression
d. Scriplet

19.Why do we use Servlet?


a. Maintainability
b. Reusability
c. Core functionality of all servlets
d. Both a & b

20.Which of the following are the popular commercial O/R frameworks?


a. Toplink
b. Struts
c. Hibernete
d. Both a & c

21. Which of the following is a reserved word and so can’t be used as an EL


identifier?
a. Empty
b. Erase
c. Error
d. Evoke

22. Which of the following Layer Architecture keep separate Business Objects
form Data Access Objects?
a. One-Layer Architecture
b. Two-Layer Architecture
c. Three--Layer Architecture
d. All of the above

23. Which of the following statements are true regarding RSS Newsreader?
a. RSS is a XML based format
b. RSS is a text based format
c. It represents the current news stores available on website.
d. Both a & c

24. How can we create drop-down menus, list boxes, radio buttons and check
boxes in JSF by using?
a. The HTML Custom Actions // JSP
b. The Core Custom Actions
c. None

25. What is the recommended method of deploying into Tomcat?


a. Manually moving the files into a project folder
b. Using a WAR file
c. Editing the servlet.xml file
d. Defending a context

26. Which of the following handle HttpServlet response?


a. DoPost()
b. doGet()
c. getPost
d. above a & b

27. Which of the following are Identifying bean Scope of JSF?


a. Request
b. Session
c. Page
d. Above a and b

28. Which of the implicit variable of JSP pages that may be used to access all
the other implicit object?
a. Context
b. PageContext
c. Page
d. Object

29. What are the main advantages of using an O/R framework over JDBC?
a. Using O/R you have a lot of queries and updates.
b. Better performance
c. Scalability and high availability
d. Above b & c

30. Which of the following file is a deployment descriptor?


a. WEB_INF
b. Web.xml
c. Jsp-config.sml
d. TLD

31. Choose the correct anawers related to Hibernate ?(Choose all are
applicable)
a. Hibernate is an object-relational mapping (ORM) library for the java
language
b. Hibernate provides a mapping for object-oriented domain model to a
traditional relational database.
c. Hibernate is a database
d. Above a & b

32. Which xml attribute allows us to specify XPath expressions?


a. Transform
b. Allow
c. Select
d. View

33. Which of the following technology is best used when a great deal of
programmatic control is required?
a. JSP
b. Servlet
c. JSF
d. None

34. Which of the following method would you require in removing a servlet
instance permanently form a servlet container?
a. doDelete()
b. destroy()
c. delete()
d. remove()

35. The Internationalization and Formatting tag library provides actions that
allow you to control the – settings for your JSP pages
a. Date
b. Locale
c. Time

36. Which of the following configurator file is responsible for Hibernat


connection?
a. Context.xml
b. Hibernat.cfg.xml
c. *.hbrn.xml

37. The Servlet interface has lifecycle methods the following


a. Init()
b. Service()
c. Destroy()
d. All of the above

38. What is the abbreviation of JSP?


a. Java Service Programming
b. Java Server Programming
c. Java Service Page
d. Java Server Pages

39. Which one is the correct include core jstl library ?


a. <%@ taglib uri=http://java.sun.com/jstl/core prefix=”c”%>
b. <%@ taglib uri=http://java.sun.com/jsp/jstl/core prefix=”c”%>
c. <%@ taglib uri=http://java.sun.com/jsf/core prefix=”c”%>

40. What is the purpose of attributes in terms of classic Tag?


a. Wrap up functionalities for the tag
b. Wrap up XML for the tag
c. Without attribute tag does not execute
d. None of the above

41. What is the method of jspServer of HttpJspPage?


a. Void_jspService(HttpServletRequest, HttpServletResponse)
b. Void_jspService()
c. Void_jspService(HttpServletRequest, HttpServletResponse) throws
IOException, ServletException

42. Which are the correct about Model 1 Architecture?(choose all that are
applicable)
a. Quick and simple
b. Page centric
c. Complex
d. Not page centric
e. Above a & b

43. Which of the following is examples of JSP directive?


a. Include
b. Exclude
c. Import
d. Taglibrary

44. The prefix f: in JSF refers to _________


a. HTML elements tor the page
b. Core JSF Functionality for the page
c. Input text fields in the form
d. None

45. Which of the following are the basic deployment technique? (choose two)
a. Expanded directory format
b. JAR
c. WAR
d. Class
e. Both a & c

46. Which package is used that you have no longer to manage database
connection parameters in your code?
a. Java.sql.DriverManager
b. Org.git.mm.mysql.Driver
c. Javax.sql.DataSource
d. None

47. Which of the followings are JSF action Tags?


a. <c:choose>
b. <sql:set.DateSource>
c. <h:dataTable>
d. <f:selectItem>
e. Both c & d

48. Which of the following are JSP Action tags are used for bean
development?
a. Jsp:useBean
b. Jsp:setProperty
c. jsp:getProparty
d. All of the above

49. The &lt;c:if%gt; Actionws has a mandatory attribute


a. Id
b. Var
c. Test

50. Which of the following two JAR files required for JSTL implementation?
a. Commons-collections.jar
b. X.tld
c. Standard.jar
d. Jstl.jar
e. Above c & d

51. Which tag provide a generic way to access URL-based resources that can
be either included or processed ?
a. <c:import>
b. <c:url>
c. <c:param>

52. What is the purpose of DAO pattern?


a. It is used for encapsulating data access
b. IT is used for authentication
c. It is used for caching
d. None

53. Which of the following is not an implicit object?


a. Request
b. Response
c. Cookie
d. Session

54. What is the main purpose of using EL?


a. To remove XML from JSP pages
b. To remove standard actions from JSP pages
c. To remove java syntax From JSP pages

55. Which of the following properties provide an easy facility for


internationalizing and customizing the pages for JSF?
a. Java
b. Tag library
c. Message Bundles
d. None

56. Where do you put your JAR file under the WEB-INF folder when the JAR
file contains all the custom tags that you created?
a. WEB-INF/classes
b. WEB-INF/lib
c. WEB-INF/common
d. WEB-INF/tlds

57. Which of the following ways you can terminate session? (choose two)
a. Session.invalidate()
b. Session.destroy()
c. Session.timeout
d. Logout

58. When destroy() method of a filter is called?


a. The destroy() method is called only once at the beginning of the life
cycle of a filter
b. The destroy() method is called after the filter has executed
c. The destroy() method is called only once at the end of the life cycle
of a filter
d. The destroy() method is called after the filter has executed doFilter
method

59. Which of the following is a server-side technology?


a. Html
b. Jsp
c. Javascript
d. Css

60. To define Faces Servlet in web.xml <servlet> <servlet-name>Faces Servlet


</servlet-name> class>blank </servlet-class> <load-on-startup>1</load-on-
startup> <servlet> the value of blank </servlet>
a. javax.faces.webapp.ext.FacesServlet
b. javax.faces.webapp. FacesServlet
c. javax.faces.webapp.Servlet. FacesServlet
d. None of the above

61. What is the primary job of the action tag?


a. To configure a data source
b. To catch exception
c. Formatting tag library
d. None

62. Evaluate the following JSP script and select the right option----------
1.<%--inside code here--%>
2.
3.
4.Today is: <%= new Date()%>
5.
6.
What needs to go on line 1
a. <%@ page import =”#{java.util.Date}”%>
b. <%@ import class=”#{java.util.Date}”%>
c. <%@include file=”#{java.util.Date}”%>
d. <%@ include class=”#{java.util.Date}”%>

63. Which of the following are JSTL Action elements?


a. Stander
b. Custom
c. SQL
d. Core
e. Above c & d

You might also like