Web Design and Development MCQs with Answers
Practice important Web Design and Development MCQs with answers and explanations.
Multiple Choice Questions
Q571: What does the flush attribute do in the <jsp:include> action element?
- A: Ensures that included content is written immediately to the output stream
- B: Specifies the relative URL of the file to be included
- C: Sets the scope of the included page
- D: Defines the properties of the included bean
View Answer
A
Q572: What is the correct format of the <jsp:forward> action element to forward a request to "anotherPage.jsp"?
- A:
- B:
- C:
- D:
View Answer
A
Q573: How does the <jsp:setProperty> action element handle implicit type conversion?
- A: It converts string values to the appropriate type for bean properties automatically
- B: It requires manual conversion before setting the property
- C: It sets properties without any conversion
- D: It only works with properties of type String
View Answer
A
Q574: What is the main difference between page and request scopes in JSP?
- A: page scope is limited to the same JSP page, while request scope is available across multiple pages within the same request
- B: request scope is limited to the same JSP page, while page scope is available across multiple pages within the same request
- C: page scope is available for the entire session, while request scope is only available for a single page
- D: request scope persists throughout the web application, while page scope is temporary
View Answer
A
Q575: What is the purpose of the getSum() method in the SumBean class?
- A: To calculate the sum of firstNumber and secondNumber
- B: To set the value of the sum property
- C: To retrieve the value of the sum property
- D: To initialize firstNumber and secondNumber
View Answer
C
Q576: What is the primary purpose of using custom tags in JSP?
- A: To handle business logic
- B: To simplify HTML coding
- C: To encapsulate complex functionality
- D: To manage database connections
View Answer
C
Q577: Which interface must be implemented to create a tag handler class for custom tags?
- A: TagHandler
- B: SimpleTag
- C: TagSupport
- D: SimpleTagSupport
View Answer
D
Q578: What does the doTag() method in a custom tag handler class do?
- A: Initializes tag attributes
- B: Processes the tag and generates output
- C: Handles tag library descriptor
- D: Parses JSP content
View Answer
B
Q579: What is the file extension for the Tag Library Descriptor (TLD) file?
- A: .tag
- B: .tld
- C: .xml
- D: .jsp
View Answer
B
Q580: Which directive is used to refer to a TLD file in a JSP page?
- A: <%@ page %>
- B: <%@ include %>
- C: <%@ taglib %>
- D: <%@ import %>
View Answer
C