Web Services Development MCQs with Answers
Practice important Web Services Development MCQs with answers and explanations.
Multiple Choice Questions
Q471: Which method in RequestDispatcher is used to include a resource?
- A: forward
- B: send
- C: include
- D: dispatch
View Answer
C
Q472: What does HttpSession manage in a servlet application?
- A: User authentication
- B: User state
- C: Database connection
- D: File handling
View Answer
B
Q473: What does the forward() method in a servlet do?
- A: Redirects the client to another servlet
- B: Forwards the request to a resource
- C: Closes the connection
- D: Starts a new session
View Answer
B
Q474: How many types of cookies are there in servlets?
- A: 2
- B: 3
- C: 4
- D: 5
View Answer
A
Q475: Which cookie is valid only for a single session?
- A: Persistent cookie
- B: Non-persistent cookie
- C: Session cookie
- D: Temporary cookie
View Answer
B
Q476: What happens to a non-persistent cookie when the browser is closed?
- A: It is saved
- B: It is removed
- C: It is stored temporarily
- D: It is shared with the server
View Answer
B
Q477: How is a persistent cookie removed?
- A: On closing the browser
- B: On user logout/signout
- C: Automatically after a session
- D: Manually by the user
View Answer
B
Q478: What is one advantage of using cookies?
- A: Cookies are stored on the server
- B: Simplest technique for state
- C: Complex technique for state
- D: Cookies are faster than other
View Answer
B
Q479: What is a major disadvantage of cookies?
- A: Cookies are encrypted
- B: Cookies support complex data
- C: Cookies can be disabled in browser
- D: Cookies store large data
View Answer
C
Q480: Which class is used to create cookies in servlets?
- A: javax.servlet.Cookie
- B: javax.servlet.http.Cookie
- C: javax.servlet.util.Cookie
- D: javax.servlet.net.Cookie
View Answer
B