JSP Interview Questions and Answers
Difficulty Level: AllBeginnerIntermediateExperienced/Expert
Ques 1. What is JSP Compiler and where are compiled JSP Java files?
Ques 2. Is JSP technology extensible?
Ques 3. What is the ResourceBundle class in JSP?
Ques 4. What is the difference between a Scrollbar and a ScrollPane in JSP?
Ques 5. What is a Java package and how is it used?
Ques 6. What are the Object and Class classes used for?
Ques 7. How can a servlet refresh automatically if some new data has entered the database?
Ques 8. The code in a finally clause will never fail to execute, right?
Ques 9. How many JSP scripting elements are there and what are they?
Ques 10. In the Servlet 2.4 specification SingleThreadModel has been deprecated, why?
Ques 11. How do I include static files within a JSP page?
Ques 13. How can I enable session tracking for JSP pages if the browser has disabled cookies?
Ques 14. How do I prevent the output of my JSP or Servlet pages from being cached by the browser?
Ques 15. How do you restrict page errors display in the JSP page?
Ques 16. What is the difference between JSP and Servlets?
Ques 17. Difference between GET and POST.
Ques 18. What is a output comment?
Ques 19. What is a Hidden Comment?
Ques 20. How do I include static files within a JSP page?
Ques 21. What are the two kinds of comments in JSP and what’s the difference between them.
Ques 22. What is a Expression?
Ques 23. What is a Declaration?
Ques 25. Why are JSP pages the preferred API for creating a web-based client program?
Ques 26. Difference between forward and sendRedirect?
Ques 27. What are the different scope valiues for the <jsp:useBean>?
Ques 28. Explain the life-cycle mehtods in JSP?
Ques 29. How do I prevent the output of my JSP or Servlet pages from being cached by the browser?
Ques 31. Is there a way to execute a JSP from the comandline or from my own application?
Ques 32. How does JSP handle run-time exceptions?
Ques 34. How do I use a scriptlet to initialize a newly instantiated bean?
Ques 38. How is scripting disabled?
Ques 39. What is the difference between ServletContext and PageContext?
Ques 40. What is a JSP and what is it used for?
Ques 41. What is difference between custom JSP tags and beans?
Ques 42. What are the two kinds of comments in JSP and what's the difference between them ?
Ques 43. What is JSP technology?
Ques 45. What are the implicit objects?
Ques 46. How many JSP scripting elements and what are they?
Ques 47. Why are JSP pages the preferred API for creating a web-based client program?
Ques 48. Can we use the constructor, instead of init(), to initialize servlet?
Ques 49. How can a servlet refresh automatically if some new data has entered the database?