Q) What is JSP?
A) Java Server Pages technology (JSP) is used to create dynamic web page.It is an extension to the servlet.A JSP is internally converted into servlet.
Q) What are the life-cycle methods for a jsp?
A) 1) public void jspInit(): It is invoked only once, same as init method of servlet.
2) public void _jspService(ServletRequest request,ServletResponse)throws ServletException,IOException: It is invoked at each request, same as service() method of servlet.
3) public void jspDestroy():It is invoked only once, same as destroy() method of servlet..
Q) How can we handle the exceptions in JSP?
A) There are two ways to perform exception handling, one is by the errorPage element of page directive, and second is by the error-page element of web.xml file.
Q) Can we use the exception implicit object in any jsp page?
A) No. The exception implicit object can only be used in the error page which defines it with the isErrorPage attribute of page directive.
Q)How is JSP used in the MVC model?
A) JSP is usually used for presentation in the MVC pattern (Model View Controller ) i.e. it plays the role of the view. The controller deals with calling the model and the business classes which in turn get the data, this data is then presented to the JSP for rendering on to the client.
Q) What are implicit objects? List them?
A) Certain objects that are available for the use in JSP documents without being declared first. These objects are parsed by the JSP engine and inserted into the generated servlet. The implicit objects re listed below
->request
->response
->pageContext
->session
->application
->out
->config
->page
->exception
Q) What are the different scope valiues for the < jsp:useBean >?
A) The different scope values for < jsp:useBean > are
1. page
2. request
3.session
4.application
A) Java Server Pages technology (JSP) is used to create dynamic web page.It is an extension to the servlet.A JSP is internally converted into servlet.
Q) What are the life-cycle methods for a jsp?
A) 1) public void jspInit(): It is invoked only once, same as init method of servlet.
2) public void _jspService(ServletRequest request,ServletResponse)throws ServletException,IOException: It is invoked at each request, same as service() method of servlet.
3) public void jspDestroy():It is invoked only once, same as destroy() method of servlet..
Q) How can we handle the exceptions in JSP?
A) There are two ways to perform exception handling, one is by the errorPage element of page directive, and second is by the error-page element of web.xml file.
Q) Can we use the exception implicit object in any jsp page?
A) No. The exception implicit object can only be used in the error page which defines it with the isErrorPage attribute of page directive.
Q)How is JSP used in the MVC model?
A) JSP is usually used for presentation in the MVC pattern (Model View Controller ) i.e. it plays the role of the view. The controller deals with calling the model and the business classes which in turn get the data, this data is then presented to the JSP for rendering on to the client.
Q) What are implicit objects? List them?
A) Certain objects that are available for the use in JSP documents without being declared first. These objects are parsed by the JSP engine and inserted into the generated servlet. The implicit objects re listed below
->request
->response
->pageContext
->session
->application
->out
->config
->page
->exception
Q) What are the different scope valiues for the < jsp:useBean >?
A) The different scope values for < jsp:useBean > are
1. page
2. request
3.session
4.application
No comments:
Post a Comment