Web Services Development MCQs with Answers
Practice important Web Services Development MCQs with answers and explanations.
Multiple Choice Questions
Q461: What is the default port number of Apache Tomcat?
- A: 9999
- B: 8080
- C: 9090
- D: 8005
View Answer
B
Q462: To change the port number in Apache Tomcat, which file should be edited?
- A: web.xml
- B: server.xml
- C: tomcat.conf
- D: context.xml
View Answer
B
Q463: Which method of RequestDispatcher is used to forward a request?
- A: include
- B: forward
- C: dispatch
- D: send
View Answer
B
Q464: What is the correct way to deploy a servlet project in Apache Tomcat?
- A: By creating a WAR file
- B: By selecting the WAR file from UI
- C: By copying project to webapps
- D: By selecting the folder from server
View Answer
C
Q465: What is the primary use of the ServletContext object?
- A: To maintain session
- B: To store servlet attributes
- C: To share configuration data
- D: To handle servlet requests
View Answer
C
Q466: Which of the following methods is used to get an attribute in ServletContext?
- A: getInitParameter
- B: getAttribute
- C: setAttribute
- D: removeAttribute
View Answer
B
Q467: What is the primary advantage of a WAR file?
- A: It reduces deployment time
- B: It helps in project debugging
- C: It improves code readability
- D: It makes the project smaller in size
View Answer
A
Q468: Which session tracking technique stores small information on the client side?
- A: HttpSession
- B: URL Rewriting
- C: Hidden Form Fields
- D: Cookies
View Answer
D
Q469: Which method is used to get the ServletContext object?
- A: getRequestDispatcher
- B: getServletContext
- C: getServletConfig
- D: getInitParameter
View Answer
B
Q470: What is the method to include the content of another resource in Servlet?
- A: forward
- B: include
- C: dispatch
- D: send
View Answer
B