Professional Documents
Culture Documents
Experienced/: Which Are The Modules of Web Layer?
Experienced/: Which Are The Modules of Web Layer?
com/java-questions-answers-freshers-
experienced/
1.Spring is a
A-Framework
2.
Which are the modules of Web layer?
A - WebSocket, Servlet, Web, Portlet
B - WebSocket, Servlet, Web-MVC, Web
C - HTML, JSP, WEB, Portlet
D - HTML, Servlet, WEB, Portlet
C - AdvancedApplicationContext, FileApplicationContext
D - FileSystemApplicationContext, ClassPathApplicationContext
C - Autowiring injects one bean into another.
D - Autowiring helps in wiring a list of values, allowing duplicates.
B - global-session
C - prototype
D - request
6. Which of the following class can be used to execute Sql
queries in spring?
B - JDBCHelper
A - JdbcTemplate
C - DBHelper
D - DBTemplate
C - It is a technique to get dependencies of any project.
D - It is used to promote tight coupling in code.
B - Core, Context, ORM, Web
C - Core, Context, Aspects, Test
D - Bean, Core, Context, Test
B - Constructor based, Setter based, Getter Based
C - Setter based, Getter based, Properties based
D - Constructor based, Setter based, Properties based
D - BeanFactory, ApplicationContext, BeanContext
B - JdbcTemplateCall
C - JdbcTemplate
D - SimpleJdbcCall
13. Which class acts as IoC Container?
A - ServletContext
B - DispatcherServlet
C - ApplicationContext
D - None of the above
14. Which of the following is correct about dependency
injection?
A - It helps in decoupling application objects from each
other.
B - It helps in deciding the dependencies of objects.
C - It stores objects states in database.
D - It stores object states in file system.
C - request
D - session
B - SessionFactory object allows for a Session object to be instantiated.
C - The SessionFactory is a thread safe object.
B - <list>
C - <bag>
D - <map>
18. Which of the following is a core component of Hibernate?
A - Transaction
B - SessionFactory
C - Session
B - The Java class name is specified using the name attribute of the class element.
C - The database table name is specified using the table attribute of the class element.
C - <ManyToOne>
D - None of the above
B - false
23. Which of the following database is supported by Hibernate?
A - DB2/NT
B - PostgreSQL
C - Sybase SQL Server
C - Both of the above.
D - None of the above.
25. Which of the following is true about ORM?
A - ORM stands for Object-Relational Mapping.
B - ORM is a programming technique for converting data between relational databases.
B - hibernate-config
C - class
D - class-config
B - <list>
C - <bag>
D - <map>
C - Both of the above.
D - None of the above.
C - Session.update()
D - Session.load()
B - save saves the object and returns status whereas persist stores status in different variable.
C - save saves the object and returns the id of the instance
whereas persist do not return anything after saving the
instance.
D - None of the above.
C - Hybrid Query Language
D - None of the above.
B - true
34. name attribute of @Column annotation permits the name of
the column to be explicitly specified.
A - true
B - false
B - The name attribute of the element refers to the property in the class.
C - The column attribute of the element refers to the column in the database table.
B - Provider
C - Criteria
D - Query
37. Which method is used to save the state of the given instance
from the underlying database?
A - Session.store()
B - Session.keep()
C - Session.save()
D - Session.load()
B - Hibernate manipulates Complex associations of objects of your database.
C - Hibernate minimize database access with smart fetching strategies.
B - Class marked with @Entity annotation must have a no-argument constructor that is visible with at least
protected scope.
C - primaryKey
D - None of the above.
B - <list>
C - <bag>
D - <map>
B - ORM system hides details of SQL queries from OO logic.
C - ORM system helps in Transaction management and automatic key generation.
C - context
D - pageContext
44. Which of the following attributes are mandatory in <jsp:getProperty /> tag?
A - name, property
B - type, id
45. Which of the following method can be used to read a form parameter in JSP?
A - request.getParameter()
B - response.getParameter()
C - request.getValue()
D - response.getValue()
A - The <c:choose> works like a Java switch statement in that it lets you choose between a number of
alternatives.
B - HttpRequest
C - HttpServletRequest
D - ServletRequest
A - language
B - extend
C - export
D - import
49. Which of the following attribute is used to mark a page as error processing page?
A - isErrorPage
B - errorPage
C - exception
D - exceptionPage
B - It evaluates an expression and displays its body content only if the expression evaluates to true.
D - type,property
52. Which of the following attribute is used to have uncaught run-time exceptions automatically forwarded to
an error processing page?
A - error
B - errorPage
C - exception
D - exceptionPage
A - The autoFlush attribute can specify that buffered output should be flushed automatically when the buffer is
filled.
B - The autoFlush attribute can specify that an exception should be raised to indicate buffer overflow.
54. Is it possible to include files using absolute path in a JSP page using include directive?
A - true
B - false
B - Internationalization means enabling a web site to provide different versions of content translated
into the visitor's language or nationality.
B - response
C - cookie
D - session
B - javax.servlet.ServletConfig
C - javax.servlet.Context
D - javax.servlet.Application
B - include directive tells the container to merge the content of other external files with the current JSP during
the translation phase.
61. Which of the following depicts correct order of phases in JSP life cycle?
A - Compilation, Initialization, Execution, Cleanup
62. Which of the following attributes are used in <jsp:include /> tag?
A - id, type
B - page, flush
D - type,page
63. What is difference between <%-- comment --%> and <!-- comment -->?
A - <%-- comment --%> is JSP comment. <!-- comment --> is an HTML comment.
B - The <c:forEach > is used to iterate over a list of items in jsp.
65. If a jsp is to generate a pdf page, what attribute of page directive it should use?
A - contentType
B - generatePdf
C - typePDF
B - contentPDF
B - Cookies are binary files stored on the server computer and they are kept for various information tracking
purpose.
C - Cookies are binary files stored on the client computer and they are kept for data storage purpose.
C - Localization means adding resources to a web site to adapt it to a particular geographical or cultural
region for example Hindi translation to a web site.
B - Custom tags are used to implement actions and JavaBeans are used to present information.
C - Both of the above.
B - False
a. Generic Servlets
b. HttpServlets
c. All of the above
d. None of the above
72. Which cookie it is valid for single session only and it is removed each time
when the user closes the browser?
a. Persistent cookie
b. Non-persistent cookie
c. All the above
d. None of the above
73. Which method is used to send the same request and response objects to
another servlet in RequestDispacher ?
a. forward()
b. sendRedirect()
c. Both A & B
d. None of the above
74. Which packages represent interfaces and classes for servlet API?
a. javax.servlet
b. javax.servlet.http
c. Both A & B
d. None of the above
75. Which class can handle any type of request so that it is protocol-
independent?
a.GenericServlet
b. HttpServlet
c. Both A & B
d. None of the above
76. Which HTTP Request method is non-idempotent?
a.GET
b. POST
c. BOTH A & B
d. None of the above
77. Which object is created by the web container at time of deploying the
project?
a.ServletConfig
b. ServletContext
c. Both A & B
d. None of the above
80. Which one of the following scopes does the attribute in servlet is an object
that can be set, get or removed?
a.session scope
b. request scope
c. application scope
d. All mentioned above
81. Which are the examples of Application Server?
a.Apache
b. Tomcat
c. JBoss
d. Weblogic
e. Both C & D
a.If number of clients increases, it takes more time for sending response
b. For each request, it starts a process and Web server is limited to start processes
c. It uses platform dependent language e.g. C, C++, perl
d. All mentioned above
83. When we are sending data in URL in get method, how to separate separate
path and parameter?
a.comma
b.?
c.&
d.None of these
a.Server
b.Client
c.Both A and B
d.None of these
86.PrintWriter is in _______package.
a.io
b.util
c.servlet
d.None of these
a.javax.servlet
b.javax.servlet.http
c.java.servlet.http
d.None of these
a.javax.servlet
b.javax.servlet.http
c.java.servlet.http
d.None of these
a.javax.servlet
b.javax.servlet.http
c.java.servlet.http
d.None of these
90.URL rewriting uses ________html element to send data.
a. <a>
b. <li>
c. <ul>
d. None of these
91._______among the following is used to send data and requires extra page
submission.
b.Session
c.SessionFactory
d.None of these