JSP and Servlet Interview Questions Part-1
1} What is JSP? Ans : Java Server Pages technology (JSP) is used to create dynamic web page. It is an extension to the servlet technology. A JSP page is internally converted into servlet. 2} What are the life-cycle methods for a jsp? Ans: public void jspInit() It is invoked only once, same as init method of servlet. public void _jspService(ServletRequest request,ServletResponse)throws ServletException,IOException It is invoked at each request, same as service() method of servlet. public void jspDestroy() It is invoked only once, same as destroy() method of servlet. 3} What are the JSP implicit objects ? Ans: JSP provides 9 implicit objects by default. They are as follows: Object (Its Type) 1) out (JspWriter) 2) request (HttpServletRequest) 3) response (HttpServletResponse) 4) config (ServletConfig) 5) session (HttpSession) 6) application (ServletContext) 7) pageContext (PageContext) 8) page (Object) 9) exception (Throwable) 4} What is servlet? A: A s...