Page |1
PRJ321 Questions with Detailed Verified
Answers (100% Correct Answers) /Already
Graded A+
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
Ans: 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");
Ans: b d
Which JSTL tag likes <%= ... >?Select one:
a. <c:out.print>
b. <c:output>
c. <c:in>
d. <c:out>
Ans: d
What is the difference between MVC1 and MVC2?
, Page |2
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.
Ans: 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.
Ans: 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
Ans: 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.
, Page |3
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
Ans: b d
Which method is used to perform DML statements in JDBC?
a. executeResult()
b. execute()
c. executeUpdate()
d. executeQuery()
Ans: 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)
Ans: e
What is the HTTP 1.1 status code that indicates: Everything's fine? Select one:
a. 200
b. 101
c. 202
d. 201
, Page |4
Ans: 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
Ans: b
What object will represent the output stream for the JSP page?
a. dispatch
b. out
c. response
d. writer
Ans: 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
Ans: d
Which is not method of the request object - an instance of HttpServletRequest.
a. sendRedirect(url)
b. getSession()
c. getCookies()
d. getParameterValues(name)
Ans: a
What are benefits of implements ModelDriven for action class? Choose 2 Select one or more:
PRJ321 Questions with Detailed Verified
Answers (100% Correct Answers) /Already
Graded A+
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
Ans: 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");
Ans: b d
Which JSTL tag likes <%= ... >?Select one:
a. <c:out.print>
b. <c:output>
c. <c:in>
d. <c:out>
Ans: d
What is the difference between MVC1 and MVC2?
, Page |2
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.
Ans: 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.
Ans: 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
Ans: 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.
, Page |3
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
Ans: b d
Which method is used to perform DML statements in JDBC?
a. executeResult()
b. execute()
c. executeUpdate()
d. executeQuery()
Ans: 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)
Ans: e
What is the HTTP 1.1 status code that indicates: Everything's fine? Select one:
a. 200
b. 101
c. 202
d. 201
, Page |4
Ans: 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
Ans: b
What object will represent the output stream for the JSP page?
a. dispatch
b. out
c. response
d. writer
Ans: 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
Ans: d
Which is not method of the request object - an instance of HttpServletRequest.
a. sendRedirect(url)
b. getSession()
c. getCookies()
d. getParameterValues(name)
Ans: a
What are benefits of implements ModelDriven for action class? Choose 2 Select one or more: