Win a copy of TDD for a Shopping Website LiveProject this week in the Testing 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
  • Paul Clapham
  • Ron McLeod
  • Jeanne Boyarsky
  • Tim Cooke
Sheriffs:
  • Liutauras Vilda
  • paul wheaton
  • Henry Wong
Saloon Keepers:
  • Tim Moores
  • Tim Holloway
  • Stephan van Hulst
  • Carey Brown
  • Frits Walraven
Bartenders:
  • Piet Souris
  • Himai Minh

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
 
Liar, liar, pants on fire! refreshing plug:
Free, earth friendly heat - from the CodeRanch trailboss
https://www.kickstarter.com/projects/paulwheaton/free-heat
reply
    Bookmark Topic Watch Topic
  • New Topic