• Post Reply Bookmark Topic Watch Topic
  • New Topic

Error Page

 
vikram nalagampalli
Ranch Hand
Posts: 91
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi all,
I am aunthenticating username and password, which are both numeric in database.
When i am inputting other than numeric values in these TEXT fields i am encountering an error which is saying "invaild column".
I want to know if i can show an common error page if something unexpected happens rather than showing a tomcat generated error.
I read, and thries using Is error page=true and then calling the error page. But it is not working, may be bcos i did not know how to use.
Can any one tell me how i can do this?
Thanks
vikram
 
William Brogden
Author and all-around good cowpoke
Rancher
Posts: 13078
6
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
If your <%@ page tag designates an error page URL, and that error page has isErrorPage="true", then an Error or Exception thrown by the first page should be available on your error page as the builtin variable "exception". You can then extract debugging information from the exception just like you would in a catch block.
Note that you don't call the error page in your code, it gets called by the JSP engine when an Exception or Error is generated and not caught in your page.
Bill

------------------
author of:
 
Abhinav Sharma
Greenhorn
Posts: 25
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
hi buddy,
To generate a user defined error page. You need to first create a error page. And then the page where this error is generated write this above the html tag "<%@ page errorPage="error.jsp"%>". error.jsp is the error page created by you. This code "<%@ page isErrorPage="true" import="java.io.*" %>" you have to write in the error.jsp not on the main file. So whenever a exception occurs the error page will be generated. I hope this solves your querry
abhinav
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!