Page: 9
Unit-1: The Servlet Technology Model
Answers
Q1. Answer: A
Q2. Answer: A, B
Q3. Answer: A, B
Q4. Answer: F
Q5. Answer: A
Q6. Answer: B, F
Q7 Answer: D
Q8. Answer: C
Q9. Answer: B
Q10. Answer:
1st:web container loads the servlet class.
2nd:web container instantiates the servlet
3rd. web container calls the servlets init() method.
4th: web container calls the servlets service() method.’
5th: web container calls the servlets destroy() methos.
Q11. Answer: A, B
Q12. Answer: E
Q13. Answers:
nbsp; Mybox.example.com : getRemoteHost
nbsp; 10.0.1.11 : getRemoteAddr
Q14. Answer: A, D
Q15.
Q16. Answers:
getServletPath()------à /control
getPathInfo() --------à /processorder
getContext() --------à /myapp
Q17. Answer: D
Q18. Answer: B, F
Q19. Answer: B, E
Q20.Ans: D
Q21.Ans: E
Q22.Ans: D and E
Q23. Ans: A
Q24. Ans: C
Q25.
Q26. Ans: 5
Q27 Ans: D
Q28. Ans: A
Q29. Ans: B and E
Q30. Ans: E
Q31. Ans: C
Q32. Ans: C
Q33.Ans: D
Q34.Ans:B
Option B show the correct method call passing in the header name as a String parameter
Q35. Ans:C
This method is typically used for troubleshooting, not for production
Q36. Ans: D
Option D is correct and of the methods listed, it’s the only one that exists in
HttpServletResponse
Q37. Ans: B
By design POST is meant to convey request to update the state of the server. In general same update should not be applied multiple times.
Q38. Ans: B
Option B specifies the correct method and the correct return type
Q39. Ans:B
Option B shows the correct way to set an HTTP header with two String parameters one representing the header name and other the value.
Q40. Ans:B
Option a is incorrect because it uses a character orented PrintWriter
Q41. Ans: B Options C-F are wrong because these methods don’t exist
Q42. Ans: A,B,C
Options A,B and C all relate to components of an HTTP request.
Q43. Ans: D
Option D is correct developers typically focus on the doGet ( ), and doPost( ) methods
Get Answers For All Questions
Page: 9
1
2
3
4
5
6
7
8
9