In article < om>,
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