FREE eBook: Java Interview Questions (250+ Questions)Email address: Because 45,991 Developers can't be Wrong!× The request cannot be fulfilled by the server AVAJAVA Web Tutorials Total Categories: 24, Total Tutorials: 508 JSPs: 4 of 9 tutorials How do I create a JSP error page to handle particular error codes? In this case, either specify exception-type or error-code with the location element. This is more significant if we're displaying exception information, since the isErrorPage="true" makes available an 'exception' object for use on the error page. Source
If you want to handle all the exception, you will have to specify the java.lang.Exception in the exception-type element. JournalDevJava, Java EE, Android, Web Development TutorialsJava Tutorial#Index PostsCore Java TutorialJava Design PatternsServlet JSP TutorialStruts 2 TutorialSpring TutorialJSF TutorialPrimefaces TutorialJDBC TutorialHibernate TutorialMongoDB Tutorial#Interview QuestionsJava Interview QuestionsJDBC Interview QuestionsServlet Interview QuestionsJSP Interview Tutorial Categories: Ajax (1)Ant (16)Apache Web Server (8)Bioinformatics (10)Cascading Style Sheets (47)Classes and Objects (14)Database (13)Design Patterns (22)Eclipse (39)Files (62)General Java (69)JSPs (9)Java Basics (11)Linux (23)Logging (5)Maven (88)Search (12)Servlets (20)Struts (1)Text Section of web.xml
Specifying the single entry in the web.xml file will handle the exception. If you know any specific error code and you want to handle that exception, specify the error-code element instead of exception-type as given below: 1) web.xml file if you want to The entry point of the application is index.jsp whose code is given below. <%@ page language="java" contentType="text/html; charset=US-ASCII" pageEncoding="US-ASCII"%>
When JSP Error page is translated to servlet code, it extends org.apache.jasper.runtime.HttpJspBase in Tomcat.Error Page Deployment Descriptor ConfigurationMost of the times, we have a common error page that we want to When application resources throw exceptions, the error code is 500, the code is written to handle both application level exceptions and errors such as 404 - page not found.Also notice the All Rights Reserved. Web.xml Error-page Location Let's see the simple example: There are 4 files: web.xml file for specifying the error-page element index.jsp for input values process.jsp for dividing the two numbers and displaying the result error.jsp
I would love to hear your thoughts and opinions on my articles directly.Recently I started creating video tutorials too, so do check out my videos on Youtube.« JSP Directives - page, Web.xml Error-page Exception-type Web Tutorials :: JSPs :: 4. The error code and the page location where the user should be sent in the event of that error can be specified in an error-page section in web.xmlW. A 404 error happened because the resource could not be found.
Required fields are marked *CommentName * Email * Website Current [email protected] * Leave this field empty Connect with us Stay Updated! Jsp Error Page Status Code same app works with others browsers.Reply Sunil Pingale saysMarch 26, 2016 at 11:50 am yes its TrueReply Leave a Reply Cancel replyYour email address will not be published. In JSP, there are two ways to perform exception handling: By errorPage and isErrorPage attributes of page directive By
There are 3 files: index.jsp for input values process.jsp for dividing the two numbers and displaying the result error.jsp for handling the exception index.jsp