displaying error message on the new error.jsp page

Discussion in 'Java' started by ashutosh, May 27, 2005.

  1. ashutosh

    ashutosh Guest

    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.
     
    ashutosh, May 27, 2005
    #1
    1. Advertising

  2. ashutosh

    kaeli Guest

    In article <>,
    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
     
    kaeli, May 27, 2005
    #2
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. - Steve -
    Replies:
    0
    Views:
    705
    - Steve -
    Jul 6, 2004
  2. Michael

    JSP displaying wrong page.

    Michael, Sep 2, 2003, in forum: Java
    Replies:
    0
    Views:
    317
    Michael
    Sep 2, 2003
  3. DigitalUncle
    Replies:
    0
    Views:
    914
    DigitalUncle
    Nov 2, 2004
  4. Shinya Koizumi

    <%JSP:include page="hello.jsp" %>

    Shinya Koizumi, Mar 9, 2006, in forum: Java
    Replies:
    3
    Views:
    9,689
    Raymond DeCampo
    Mar 12, 2006
  5. Replies:
    0
    Views:
    4,394
Loading...

Share This Page