Win a copy of Murach's MySQL this week in the JDBC and Relational Databases forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

Error Page

 
Ranch Hand
Posts: 91
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
 
Author and all-around good cowpoke
Posts: 13078
6
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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:
 
Greenhorn
Posts: 25
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
 
I yam what I yam and that's all that I yam - the great philosopher Popeye. Tiny ad:
a bit of art, as a gift, that will fit in a stocking
https://gardener-gift.com
reply
    Bookmark Topic Watch Topic
  • New Topic