JSP Interview Questions 1. How will you implement error page in JSP? To implement an error-handling page in JSP, we first create a JSP with error page handling information. In most of the cases we gracefully handle error by giving a user-friendly message like “Sorry! There is system error. Please try again by refreshing page.” In this error page, we show user-friendly message to user, but we also log important information like stack trace to our application log file. We have to add parameter isErrorPage=true in page directive of this page. This tells to JSP container that this is our error page. <%@page isErrorPage=”true” %> Now we can use this error page in other JSP where we want to handle error. In case of an error or exception, these JSP will direct it to errorPage. <% page errorPage=”ErrorPage.jsp” %> 2. How will you send XML data from a JSP? In general, JSP is used to pass HTML data to web browser. If we want to send data in XML
Top 1000+ Interview Question Java JSP Spring Hibernate java collection multithreading java string serialization and desensitization final keyword in java package java design patterns maven git repository cloud computation UNIX shell interview question