Web Design and Development MCQs with Answers
Practice important Web Design and Development MCQs with answers and explanations.
Multiple Choice Questions
Q531: In the given example, what does second.jsp do with the numbers provided?
- A: It displays the numbers
- B: It calculates their sum and displays it
- C: It converts numbers to strings
- D: It handles form submission
View Answer
B
Q532: What is the purpose of the implicit object request in JSP?
- A: To set HTTP status codes
- B: To handle HTTP responses
- C: To access request parameters and headers
- D: To send output to the client
View Answer
C
Q533: Which implicit object in JSP is used to send output to the client?
- A: request
- B: response
- C: out
- D: session
View Answer
C
Q534: How does the implicit object response help in a JSP?
- A: It provides access to request parameters
- B: It allows setting content type and HTTP status codes
- C: It stores session data
- D: It provides access to page context
View Answer
B
Q535: What does the implicit object session represent in JSP?
- A: HTTP request
- B: HTTP response
- C: Session data
- D: Page context
View Answer
C
Q536: Which implicit object in JSP allows storing values that are shared by all servlets in the same web application?
- A: session
- B: application
- C: config
- D: exception
View Answer
B
Q537: How can you specify that a JSP page handles errors?
- A: <%@ page isErrorPage="true" %>
- B: <%@ page contentType="application/vnd.ms-excel" %>
- C: <%@ include file="header.jsp" %>
- D: <%@ page import="java.util.*" %>
View Answer
A
Q538: What is the purpose of the <%@ page %> directive in JSP?
- A: To include content from other JSP files
- B: To specify page settings and imports
- C: To declare custom tag libraries
- D: To define XML namespaces
View Answer
B
Q539: Which JSP directive is used to include a file at translation time?
- A: <%@ page %>
- B: <%@ include %>
- C: <%@ taglib %>
- D: <%@ import %>
View Answer
B
Q540: What does the <%@ include file="header.jsp" %> directive do in JSP?
- A: Includes the file at request time
- B: Includes the file at translation time
- C: Sets the content type for the JSP
- D: Defines a custom tag library
View Answer
B