B correct answers 1. Which of the following methods is defined by the JSP engine? Select
one:
A. _jspService( )
B. _jspService( HttpServletRequest, HttpServletResponse)
C.jspInit( )
D. _jspService( ServletRequest, ServletResponse)
E. jspDestroy( )
C correct answers 2. In web.xml file, which of the following elements is used to configure the
timeout for sessions generated in the web application?
A. It is not allowed to specify timeout for sessions in web.xm
B. <session> timeout </session>
C. <session-timeout> timeout </session-timeout>
D. <timeout> timeout </timeout>
B correct answers 3. In a Java web application, how does login task provide to user with just
only one servlet?
A. No way, there must be jsp page for input form to send request to servlet. Servlet can only
be a Controller.
B. As a request send to servlet, doGet() will present input form for user login then doPost()
will process login data. This is not MVC architecture.
C. There is no way for user send request to such servlet if jsp/html is not used - the role of
View
D. There must be an object - model class- help the servlet to access database for login
processing.
c correct answers 4. How many numbers are printed, when the following JSTL code fragment
is executed? Select the one correct answer.<%@ taglib uri="http://java.sun.com/jsp/jstl/core"
prefix="c" %><c:forEach var="item" begin="0″ end="10″ step="2″>${item}</c:forEach>
A. 1
B. 5
C. 6
D. 11
D correct answers 5. Name of the class that includes the getSession method that is used to get
the HttpSession object.
A. HttpServletResponse
B. SessionContext
C. SessionConfig
D. HttpServletRequest
B correct answers 6. You cannot nest one JSTL choose tag within another.
A. True
B. False
, c correct answers 8. Which is correct syntax of JSTL action tag to include a resource into
current page?
A. <c:import url="abc.jsp" var="test"/>
B. <c:import var="test"/>
C. <c:import url="abc.jsp"/>
D. <c:import uri="http://abc.jsp"/>
A D correct answers 9. What is the difference between <jsp:forward page = ... > and
response.sendRedirect(url)? Choose 2
A. The <jsp:forward> forwards the request with client data, but sendRedirect(url) does not
send client data.
B. Both are the same symantic and functionality
C. <jsp:forward> is dynamic action, response.sendRedirect(url) is not
D. <jsp:forward> make change from server side, sendRedirect(url) make change to client
side.
A correct answers 10. Which of following feature does indicate "Servlet should NOT use as
dynamic page"?
A. Low lever HTML format
B. Getting auto refresh on receiving a request time
C. Initialize only once at deploy time
D. Automatically connect to the Database
B D correct answers 11. Choose correct statement on JSTL (choose 2)
A. JSTL includes tag library that can be use in JSP without any instalation.
B. JSTL provides a framework for integrating the existing custom tags with the JSTL tags
C. JSTL can be used for ordinary view, but not for JDBC access to database
D. JSTL has support for common, structural tasks and conditionals, tags for manipulating
XML documents, internationalization tags, and SQL tags
B correct answers 12. Which of the following statements about the JavaBean is true
A. JavaBean component property must only be write-only format.
B. The public methods give access to the properties of the bean.
C. It is impossible initialise the JavaBeans with arguments using jsp:useBean.
D. JavaBean is an object initialization method
D correct answers 13. _____ provides a way to identify a user across more than one page
request or visit to a Web site and to store information about that user.
A. Hidden Field
B. URL Rewrite
C. Cookie
D. Session management
C correct answers 14. Which of the following method should not be overriden in JSP?
A. jspInit()