QUESTIONS WITH VERIFIED
ANSWERS ALREADY GRADED A+
BY EXPERTS
What gets printed when the following expression is evaluated? Select the one correct
answer.${(1==2) ? 4 : 5}
a. 2
b. 3
c. 4
d. 5 - CORRECT ANSWER>>>>d
Consider the following HTML page code: Identify the two methods that can be used to retrieve
the value of the name parameter when the form is submitted. Select one or more:
a. getParameterValue( "name");
b. getParameterValues( "name");
c. getParameters( "name");
d. getParameter( "name"); - CORRECT ANSWER>>>>b d
Which JSTL tag likes <%= ... >?Select one:
a. <c:out.print>
b. <c:output>
c. <c:in>
d. <c:out> - CORRECT ANSWER>>>>d
What is the difference between MVC1 and MVC2?
a.MVC1 is page-centric, MVC2 is controller-centric
b.MVC2 is page-centric, MVC1 is controller-centric
c.The MVC1 process goes from one JSP page to another, while MVC2 directs to a common
panel before directing to another page
d.MVC2 makes use of a system controller while MVC1 doesn't. - CORRECT ANSWER>>>>c
What are Struts 2 Features? Choose 3
a. Struts 2 Actions are depend on the servlet API
b. Struts 2 Actions are thread safe
c. Any POJO class can be used as Action class.
d. No need of Action forms in Struts 2.
e. Struts 2 allows validation by using the validate() method in Action class. - CORRECT
ANSWER>>>>c d e
Which of the following statements about the Servlet is false? Select one:
a. Initialization code in servlets is executed every time the program is made to run
b. Servlets are portable
,c. Servlets are easy to use
d. All of the others
e. None of the others - CORRECT ANSWER>>>>a
The deployment descriptor for a stateless session bean that uses the isCallerInRole method reads
as follows:
3. <security-role-ref>
4. <role-name>manager</role-name>
5. <role-link>humanresources</role-link>
6. <security-role-ref>
16. <security-role>
17. <description>
18. Is allowed to view and update all employee records.
19. </description>
20. <role-name>humanresources</role-name>
21. </security-role>
Which two roles are responsible for creating this deployment descriptor? ( Choose two.) Select
one or more:
a. System Administrator
b. Bean Provider
c. Deployer
d. Application Assembler - CORRECT ANSWER>>>>b d
Which method is used to perform DML statements in JDBC?
a. executeResult()
b. execute()
c. executeUpdate()
d. executeQuery() - CORRECT ANSWER>>>>c
Which of the following methods can be used to add cookies to a servlet response? Select one:
a. HttpServletResponse.addCookie( String contents)
b. ServletResponse.addHeader( String name, String value)
c. ServletResponse.addCookie( String contents)
d. ServletResponse.addCookie( Cookie cookie)
e. HttpServletResponse.addCookie( Cookie cookie) - CORRECT ANSWER>>>>e
What is the HTTP 1.1 status code that indicates: Everything's fine? Select one:
a. 200
b. 101
c. 202
d. 201 - CORRECT ANSWER>>>>a
How does container initialize Servlet Object at deploy time?
a. The servlet must be declared into context deployment descriptor with servlet tag
b. The servlet must be declared into web deployment descriptor with servlet tag
c. The servlet must be declared into web deployment descriptor with servlet-mapping tag
, d. The servlet does not need to be declared - CORRECT ANSWER>>>>b
What object will represent the output stream for the JSP page?
a. dispatch
b. out
c. response
d. writer - CORRECT ANSWER>>>>b
How do you manage database transaction in JDBC programming?
a. Database transaction management is depends on JDBC driver
b. Database transaction is managed by DBMS server, not by JDBC driver
c. Turn on auto-commit mode to begin transaction, then commit/ rollback
d. Turn off auto-commit mode to begin transaction, then commit/ rollback - CORRECT
ANSWER>>>>d
Which is not method of the request object - an instance of HttpServletRequest.
a. sendRedirect(url)
b. getSession()
c. getCookies()
d. getParameterValues(name) - CORRECT ANSWER>>>>a
What are benefits of implements ModelDriven for action class? Choose 2 Select one or more:
a. All of the others
b. It depends on how many many model objects in application.
c. Struts will then populate the fields of this object with the request parameters, and this object
will be placed on top of the ValueStack once the action is executed.
d. Validation will also be performed on driven model object, instead of the action. - CORRECT
ANSWER>>>>c d
You can use the JSTL choose tag to perform conditional processing that's similar to an if
statement only in Java. Select one:
a. True
b. False - CORRECT ANSWER>>>>b
What are benefits of implements ModelDriven for action class? Choose 2 Select one or more:
a. It depends on how many many model objects in application.
b. All of the others
c. Struts will then populate the fields of this object with the request parameters, and this object
will be placed on top of the ValueStack once the action is executed.
d. Validation will also be performed on driven model object, instead of the action. - CORRECT
ANSWER>>>>c d
Which of the following is not a directive in JSP?
a. page
b. export
c. include