Here you can find JSP Interview Questions and Answers.
In this JSP Interview Questions and Answers section you can learn and practice JSP Interview Questions and Answers to improve your skills in order to face technical inerview by IT companies. By Practicing these interview questions, you can easily crack any JSP interview.
AllIndiaExams provides you lots JSP Interview Questions and Answers with proper explanation. Fully solved examples with detailed answer description. All students, freshers can download JSP Interview Questions and Answers as PDF files and eBooks.
You no need to worry, we have given lots of JSP Interview Questions and Answers and also we have provided lots of FAQ's to quickly answer the questions in the JSP technical interview.
What is JSP ? Describe its concept.
Java Server Pages (JSP) is a server side component for the generation of dynamic information as the response. Best suitable to implement view components (presentation layer components). It is part of SUN’s J2EE platform.
Explain the benefits of JSP?
These are some of the benefits due to the usage of JSP they are: * Portability, reusability and logic components of the language can be used across various platforms. * Memory and exception management. * Has wide range of API which increases the output functionality. * Low maintenance and easy deployment. * Robust performance on multiple requests.
Is JSP technology extensible?
Yes, it is. JSP technology is extensible through the development of custom actions, or tags, which are encapsulated in tag libraries.
Can we implement an interface in a JSP?
What are the advantages of JSP over Servlet?
* Best suitable for view components * we can separate presentation and business logic * The JSP author not required to have strong Java knowledge * If we are performing any changes to the JSP, then not required to recompile and reload explicitly * We can reduce development time.
Explain the differences between ASP and JSP?
The big difference between both of these technologies lies with the design of the software. JSP technology is server and platform independent whereas ASP relies primarily on Microsoft technologies.
Can I stop JSP execution while in the midst of processing a request?
Yes. Preemptive termination of request processing on an error condition is a good way to maximize the throughput of a high-volume JSP engine. The trick (assuming Java is your scripting language) is to use the return statement when we want to terminate further processing.
How to Protect JSPs from direct access ?
If the JSP is secured resource then we can place inside WEB-INF folder so that end user is not allowed to access directly by the name. We can provide the url pattern by configuring in web.xml Demo JSP /WEB-INF/test.jsp Demo JSP /test
Explain JSP API ?
The JSP API contains only one package : javax.servlet.jsp It contains the following 2 interfaces: JspPage: This interface defines the two life cycle methods jspInit() and jspDestroy(). HttpJspPage: This interface defines only one life cyle method _jspService() method. Every generated servlet for the jsps should implement either JspPage or HttpJspPage interface either directly or indirectly.
What are the lifecycle phases of a JSP?
Life cycle of JSP contains the following phases: 1. Page translation: -converting from .jsp file to .java file 2. Page compilation: converting .java to .class file 3. Page loading : This class file is loaded. 4. Create an instance :- Instance of servlet is created 5. jspInit() method is called 6. jspService() is called to handle service calls 7. jspDestroy() is called to destroy it when the servlet is not required.