Web Design and Development MCQs with Answers
Practice important Web Design and Development MCQs with answers and explanations.
Multiple Choice Questions
Q421: What is the standard file extension for a web application archive?
- A: .jar
- B: .zip
- C: .war
- D: .tar
View Answer
C
Q422: What does the doGet() method in a servlet handle?
- A: POST requests
- B: PUT requests
- C: GET requests
- D: DELETE requests
View Answer
C
Q423: Which package must be imported to use HttpServlet?
- A: javax.servlet
- B: javax.servlet.http
- C: java.io
- D: java.util
View Answer
B
Q424: What is the default URL pattern for accessing a servlet named HelloWorldServlet as per the web.xml configuration?
- A: /index.html
- B: /hello
- C: /myfirstservlet
- D: /HelloWorldServlet
View Answer
C
Q425: How are attribute-value pairs attached in a GET request?
- A: Within the request body
- B: After the URL with ?
- C: In the headers
- D: In the request path
View Answer
B
Q426: Which HTTP request type is used to submit data to the server?
- A: GET
- B: POST
- C: PUT
- D: DELETE
View Answer
B
Q427: How often should you restart Tomcat when adding new servlets or Java Beans?
- A: Every time
- B: Only for JSP files
- C: Once a day
- D: Once a week
View Answer
A
Q428: What is the role of the web.xml file in a web application?
- A: To compile servlets
- B: To specify servlet mappings and configuration
- C: To store JSP files
- D: To create a directory structure
View Answer
B
Q429: In which directory should you place your compiled servlet class files?
- A: C:\jakarta-tomcat-5.5.9\webapps\myapp
- B: C:\jakarta-tomcat-5.5.9\webapps\myapp\WEB-INF
- C: C:\jakarta-tomcat-5.5.9\webapps\myapp\WEB-INF\classes
- D: C:\jakarta-tomcat-5.5.9\webapps\myapp\lib
View Answer
C
Q430: What does the doPost() method in a servlet handle?
- A: GET requests
- B: POST requests
- C: PUT requests
- D: DELETE requests
View Answer
B