

Translation - JSP container checks the JSP page code and parse it to generate the servlet source code.Actually JSP container takes care of translating the JSP pages and create the servlet class that is used in web application. If you will look into JSP page code, it looks like HTML and doesn’t look anything like java classes. Although most of the containers now provide hot deployment support for applications still it’s more work that JSP pages. We don’t need to compile our project code or restart server whereas if we make a change in servlet code, we need to build the complete project again and deploy it. Just make the required changes in the JSP page and replace the old page with the updated jsp page in the deployment directory and the container will load the new JSP page. One more benefit of JSP is that most of the containers support hot deployment of JSP pages. JSP scripting elements can be used for writing Java code in JSP pages but it’s best to avoid them and use JSP action elements, JSTL tags or custom tags to achieve the same functionalities. We should avoid business logic in JSP pages and try to use it only for view purpose. Also, most of the elements on a web page are static, so the JSP page is more suitable for web pages. We can create user views in servlet also but the code will become very ugly and error-prone. JSP is extension of Servlet technology to help developers create dynamic pages with HTML like syntax. JSP is java server side technology to create dynamic web pages. Can we use JSP implicit objects in a method defined in JSP Declaration?.These are good JSP interview questions and answers for experienced programmers as well as beginners.Before you go through the answers, I would recommend you to read above tutorials and try to answer them yourself and test your understanding of JSP. Here I am providing some important JSP interview questions with answers to help you in interviews. Some of the tutorials you might look into are: We started from the basics of JSP, JSP scripting and ended with JSP custom tags to avoid java code in JSP pages. JSP is an integral part of any Java EE web application and recently I have written a lot about different features in JSP. JSP interview questions are very important if you are going for a Java interview. What is difference between JspWriter and Servlet PrintWriter?.How can we prevent implicit session creation in JSP?.When will Container initialize multiple JSP/Servlet Objects?.
#Java print new linein jsp how to
How to ignore the EL expression evaluation in a JSP?.What is jsp-config in deployment descriptor?.How do we print “ creates a new line in HTML” in JSP?.

How do we catch exception and process it using JSTL?.How can we handle exceptions thrown by JSP service method?.Why don’t we need to configure JSP standard tags in web.xml?.Give an example where you need JSP Custom Tag?.What is JSP Custom Tag and what are it’s components?.What is JSP Standard Tag Library, provide some example usage?.How to use JSP EL to get HTTP method name?.What are JSP EL implicit objects and how it’s different from JSP implicit Objects?.What is JSP Expression Language and what are it’s benefits?.What is difference between include directive and jsp:include action?.Explain JSP Action Elements or Action Tags?.

