Skip to main content

Web Services Development MCQs with Answers

Practice important Web Services Development MCQs with answers and explanations.

Multiple Choice Questions

Q491: What interface is used to create an HttpSession object in servlets?
  • A: HttpServlet
  • B: HttpSession
  • C: HttpServletRequest
  • D: HttpSessionRequest
View Answer
C

Q492: Which method invalidates a session in HttpSession?
  • A: destroySession()
  • B: invalidate()
  • C: closeSession()
  • D: deleteSession()
View Answer
B

Q493: SendRedirect works on which side?
  • A: Server
  • B: Client
  • C: Browser
  • D: Cache
View Answer
B

Q494: Forwarding a request works on which side in servlets?
  • A: Client
  • B: Server
  • C: Cache
  • D: Database
View Answer
B

Q495: How can a cookie be deleted in a servlet?
  • A: By setting its value to null
  • B: By setting its maxAge to 0
  • C: By removing it from the client
  • D: By invalidating the session
View Answer
B

Q496: Hidden form fields store which type of information?
  • A: Only textual information
  • B: Binary files
  • C: Encrypted data
  • D: Cookies
View Answer
A

Q497: URL rewriting will work even if ____ is disabled.
  • A: JavaScript
  • B: Cookies
  • C: Hidden fields
  • D: Sessions
View Answer
B

Q498: The getSession() method in HttpServletRequest returns ____.
  • A: The current HttpSession object
  • B: A new cookie
  • C: The name of the session
  • D: The session identifier
View Answer
A

Q499: What is the main purpose of a hidden form field?
  • A: To display user information
  • B: To maintain state of user
  • C: To encrypt data
  • D: To improve form design
View Answer
B

Q500: In the example provided, what is the name of the hidden field?
  • A: uname
  • B: username
  • C: hiddenField
  • D: fieldName
View Answer
A

Test Your Knowledge

Take a timed quiz on Web Services Development

🚀 Start Quiz Now