Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > Java > displaying error message on the new error.jsp page

Reply
Thread Tools

displaying error message on the new error.jsp page

 
 
ashutosh
Guest
Posts: n/a
 
      05-27-2005
i m making a project in which i m using jsp as front end, java servlet,
java beans and mysql database.
now when i enter user_id and password on my login screen(jsp page) it
authenticates with the database. if it matches its ok but if not it
displays the sql error message on the internet explorer window. i want
that when such error generates a new jsp page(error.jsp) opens
dynamically and show that error. can anybody suggest which additional
coding (or changes) do i require in my jsp page, servlet or java beans
to implement this concept.
OR u can suggest any valuable link(URL) on internet which can help me.

 
Reply With Quote
 
 
 
 
kaeli
Guest
Posts: n/a
 
      05-27-2005
In article <(E-Mail Removed) om>,
http://www.velocityreviews.com/forums/(E-Mail Removed) enlightened us with...
> i m making a project in which i m using jsp as front end, java servlet,
> java beans and mysql database.
> now when i enter user_id and password on my login screen(jsp page) it
> authenticates with the database. if it matches its ok but if not it
> displays the sql error message on the internet explorer window. i want
> that when such error generates a new jsp page(error.jsp) opens
> dynamically and show that error. can anybody suggest which additional
> coding (or changes) do i require in my jsp page, servlet or java beans
> to implement this concept.
> OR u can suggest any valuable link(URL) on internet which can help me.
>
>


Depends on how you want to handle it.

Basic JSP: (top of page)
<%@ page isErrorPage="false" errorPage="error.jsp" %>

If you don't want to throw errors all the way up the chain and have to have
the JSP error page figure out what the error was, you may want to set up the
servlet to forward to an error page instead or just write out the error
itself. Also, if part of a response has already been written, the forward
call from either a servlet or the JSP error handler will fail. You can't
forward once ANY response has been sent, including headers. Be careful, as
that can be a gotcha.

Lots of options here depending on architecture and what you want to
accomplish as a whole.

--
--
~kaeli~
When you choke a smurf, what color does it turn?
http://www.ipwebdesign.net/wildAtHeart
http://www.ipwebdesign.net/kaelisSpace

 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Error With Bound Control Causes redirection to 404 Error page instead of displaying error Bishop ASP .Net 1 02-24-2007 09:42 PM
Displaying error message in a try except? wawork@hotmail.com Python 2 12-11-2005 11:00 PM
displaying error message while turning on the system raghav Computer Support 1 10-23-2005 07:01 AM
ValidationSummary not displaying error message from datagrid regularExpressionValidator Markus ASP .Net Datagrid Control 0 03-02-2005 05:21 PM
Displaying validator error message only after validation fails Helen ASP .Net 5 09-09-2004 06:38 PM



Advertisments