Retake Practical Quiz (Page 3 of 4)

Download as pdf or txt
Download as pdf or txt
You are on page 1of 9

12:41, 05/11/2021 Retake Practical Quiz (page 3 of 4)

Question 21
Not yet answered
Marked out of 1.00

Which of the following scope can be used to store client-side user state information while avoiding any impact due to the user’s web
browser configuration?

Select one:
a. Request Scope
b. Session Scope
c. Context Scope
d. Page Scope

Question 22
Not yet answered
Marked out of 1.00

Which function use to set the time alive of cookie?

Select one:
a. setInactivateInterval(int expiry)
b. invalidate(int expiry)
c. setMaxAge(int expiry)
d. setTimeOut(int expiry)

https://lms-hcmuni.fpt.edu.vn/mod/quiz/attempt.php?attempt=93132&cmid=5079&page=2 1/9
12:41, 05/11/2021 Retake Practical Quiz (page 3 of 4)

Question 23
Not yet answered
Marked out of 1.00

The request-scoped attribute is named datastore that contains a java.util.ArrayList of values.


What is the result of compiling and executing this JSP page with following standard action? 
<jsp: useBean id=”datastore” scope=”request” class=”java.util.HashMap” />

Select one:
a. A ClassCastException is thrown at compile time
b. A translation error occurs
c. A ClassCastException is thrown at run time
d. The scoped attribute is replaced with a new HashMap instance, and the JSP scripting variable created to hold this value.

Question 24
Not yet answered
Marked out of 1.00

Which JSTL tag has similar function with <jsp:include> standard action?

Select one:
a. <c:page>
b. <c:include>
c. <c:file>
d. <c:import>

https://lms-hcmuni.fpt.edu.vn/mod/quiz/attempt.php?attempt=93132&cmid=5079&page=2 2/9
12:41, 05/11/2021 Retake Practical Quiz (page 3 of 4)

Question 25
Not yet answered
Marked out of 1.00

Which of the following is a properly formatted taglib element occurring in web.xml?

Select one:
a. <taglib>
<taglib-uri>/graph</taglib-uri>

<taglib-location>/WEB-INF/Charts.tld</taglib-location>

</taglib>
b. <taglib>
<taglib-name>/graph</taglib-name>

<taglib-location>/WEB-INF/Charts.tld</taglib-location>

</taglib>
c. <taglib>
<uri>/graph</uri>

<location>/WEB-INF/Charts.tld</location>

</taglib>
d. <taglib>
<lib-uri>/graph</lib-uri>

<lib-location>/WEB-INF/Charts.tld</lib-location>

</taglib>

https://lms-hcmuni.fpt.edu.vn/mod/quiz/attempt.php?attempt=93132&cmid=5079&page=2 3/9
12:41, 05/11/2021 Retake Practical Quiz (page 3 of 4)

Question 26
Not yet answered
Marked out of 1.00

Which of the following is part of status line in response message?

Select one or more:


a. HTTP Methods.
b. Status
c. HTTP Version.
d. Response Code.
e. Header Information.
f. Status Code.

https://lms-hcmuni.fpt.edu.vn/mod/quiz/attempt.php?attempt=93132&cmid=5079&page=2 4/9
12:41, 05/11/2021 Retake Practical Quiz (page 3 of 4)

Question 27
Not yet answered
Marked out of 1.00

Given file web.xml, which contains the following code:


<filter>
  <filter-name>FirstFilter</filter-name>
  <filter-class>trienhk.filters.FirstFilter</filter-class>
</filter>
<filter>
  <filter-name>SecondFilter</filter-name>
  <filter-class>trienhk.filters.SecondFilter</filter-class>
</filter>
<filter-mapping>
  <filter-name>SecondFilter</filter-name>
  <url-pattern>/FilterServlet</url-pattern>
</filter-mapping>
<filter-mapping>
  <filter-name>FirstFilter</filter-name>
  <url-pattern>/FilterServlet</url-pattern>
</filter-mapping>
Given file Filter name FirstFilter, which contains the following code:
...

chain.doFilter(request, response);
PrintWriter out = response.getWriter();
out.println("<p>First Filter<p>");

...
Given file Filter name SecondFilter, which contains the following code:

https://lms-hcmuni.fpt.edu.vn/mod/quiz/attempt.php?attempt=93132&cmid=5079&page=2 5/9
12:41, 05/11/2021 Retake Practical Quiz (page 3 of 4)

...

chain.doFilter(request, response);
PrintWriter out = response.getWriter();
out.println("<p>Second Filter<p>");

...
Given file Servlet FilterServlet, which contains the following code:
PrintWriter out = response.getWriter();
out.println("Filter Servlet");
out.close();
What is a output result in FilterServlet when requesting FilterServlet?

Select one:
a. Filter Servlet
Second Filter
First Filter
b. Filter Servlet
First Filter
Second Filter
c. Second Filter
First Filter
Filter Servlet
d. Filter Servlet

https://lms-hcmuni.fpt.edu.vn/mod/quiz/attempt.php?attempt=93132&cmid=5079&page=2 6/9
12:41, 05/11/2021 Retake Practical Quiz (page 3 of 4)

Question 28
Not yet answered
Marked out of 1.00

Which of these method is NOT included in ServletConfig interface?

Select one:
a. String getInitServlet(String name)
b. String getInitParameter(String name)
c. String getServletName()
d. ServletContext getServletContext()
e. Enumeration getInitParameterNames()

Question 29
Not yet answered
Marked out of 1.00

Which of the following is describe the correct type of the Commonly Status code?

Select one or more:


a. 4×× Client Error
b. 1×× Success
c. 3×× Informational
d. 5×× Server Error
e. 2×× Redirection

https://lms-hcmuni.fpt.edu.vn/mod/quiz/attempt.php?attempt=93132&cmid=5079&page=2 7/9
12:41, 05/11/2021 Retake Practical Quiz (page 3 of 4)

Question 30
Not yet answered
Marked out of 1.00

In this following Scope, which scope is can be destroyed using its method?

Select one:
a. Session Scope
b. Context Scope
c. Page Scope
d. Request Scope

https://lms-hcmuni.fpt.edu.vn/mod/quiz/attempt.php?attempt=93132&cmid=5079&page=2 8/9
12:41, 05/11/2021 Retake Practical Quiz (page 3 of 4)

https://lms-hcmuni.fpt.edu.vn/mod/quiz/attempt.php?attempt=93132&cmid=5079&page=2 9/9

You might also like