PRJ321 COMPLETE ACTUAL EXAM QUESTIONS WITH DETAILED
VERIFIED ANSWERS (100% CORRECT ANSWERS) /ALREADY
GRADED A+
A parameter is defined in a <context-param> element
of the deployment descriptor for a web application.
A Which of the following statements is correct?
A. It is accessible to all the servlets of the webapp.
B. It is accessible to all the servlets of all the webapps of the
container.
C. It is accessible only to the servlet it is defined for.
A........... manages the threading for the servlets and JSPs and
provides the
necessary interface with the Web server.
A A. Web Container
B. EJB Container
C. Servlets
D. Applets
Which method can be invoked on a session object so that it is never
invalidated by the servlet container automatically?
A. setMaxInactiveInterval(-1)
A B. setTimeOut(Integer.MAX_INT)
C. setMaxInactiveInterval(Integer.MAX_INT)
D. setTimeOut(-1)
Session death is more likely to come about through a time-out
mechanism. If there is no activity on a session for a predefined length of
A time, the web container invalidates the session.
A. True
B. False
/ 1/111
,3/29/25, 11:04 PM PRJ321
A___ has a name, a single value, and optional attributes such as a
comment, path
and domain qualifiers, a maximum age, and a version number.
A A. Cookie
B. Session
C. Request
D. Response
Which of the following method calls can be used to
retrieve an object from the session that was stored
using the name "roleName"?
D A. getObject("roleName");
B. getValue("roleName");
C. get("roleName");
D. getAttribute("roleName");
E. getParameter("roleName");
Which statements are BEST describe value attribute of
<jsp:setProperty value=... /> action?
A. The ID of the JavaBean for which a property (or properties)
will be set.
B. The name of the property to set. Specifying "*" for
D this attribute causes the JSP to match the request
parameters to the properties of the bean.
C. If request parameter names do not match bean
property names, this attribute can be used to specify
which request parameter should be used to obtain the
value for a specific bean property.
D. The value to assign to a bean property. The value
typically is the result of a JSP expression.
/ 2/111
,3/29/25, 11:04 PM PRJ321
Which is NOT a standard technique for a session be definitely
invalidated?
D A. The container is shutdown and brought up again.
B. No request comes from the client for more than "session
timeout" period.
C. A servlet explicitly calls invalidate() on a session object.
D. If the session time out is set to 0 using setMaxInactiveInterval()
method.
What are the different scope values for the
‹jsp:useBean›? (Choose one correct answer)
A. session, page, application, request
A B. session, page, application, global
C. session, page, application, context
D. session, page, response, request
A JSP page called test.jsp is passed a parameter name in
the URL using http://localhost/Final/test.jsp?name=John.
The test.jsp contains the following code.
<% String myName=request.getParameter("name");%>
<% String test= "Welcome " + myName; %>
<%=test%>
A
What is the output?
A. The page display "Welcome John"
B. The program gives a syntax error because of the statement
<% String myName=request.getParameter("name");%>
C. The program gives a syntax error because of the statement
<% String test= "Welcome " + myName; %>
D. The program gives a syntax error because of the statement
<%=test%>
Name the default value of the scope attribute of <jsp:useBean>
A. page
A B. session
C. application
D. request
/ 3/111
, 3/29/25, 11:04 PM PRJ321
A JSP page called test.jsp is passed a parameter name in
the URL using http://localhost/test.jsp?name="John". The
test.jsp contains the following code.
<%! String myName=request.getParameter();%>
<% String test= "welcome" + myName; %>
<%= test%>
B
What is the output?
A. The program prints "Welcome John"
B. The program gives a syntax error because of
the statement <%! String
myName=request.getParameter();%>
C. The program gives a syntax error because of the
statement <% String test= "welcome" + myName;
%>
D. The program gives a syntax error because of the statement <%=
test%>
Select the correct directive statement insert into the
first line of following lines of code (1 insert code
here):
A
A. <%@page import='java.util.*' %>
B. <%@import package='java.util.*' %>
C. <%@ package import ='java.util.*' %>
D. <%! page import='java.util.*' %>
For JSP scopes of request and page, what type of object
is used to store the attributes?
A. HttpServletRequest and ServletContext respectively.
B. ServletRequest and ServletConfig respectively.
A
C. ServletRequest and PageContext respectively.
D. HttpServletRequest and PageContext respectively.
E. ServletConfig for both.
Which of the following correctly represents the
following JSP statement? Select one correct answer.
<%=x%>
A. <jsp:expression=x/>
B B. <jsp:expression>x</jsp:expression>
C. <jsp:statement>x</jsp:statement>
/ 4/111