I think it qualifies as an EJB related question. I think what
you want to do it throw an application exception, which is
defined in the EJB spec. This exception does not extend
RuntimeException, so it may be caught by the client.

When our servlet attempts a login, and the password or username
is incorrect, our Session Bean throws an "InvalidLoginException",
which we wrote and which extends Exception. Since this is an
application exception, the container simply passes that exception
back to my servlet, and I am able to put up a specific web page
indicating what went wrong with a login form to retry the login.

Thus, send the message back as part of a specific application
exception defined just for invalid logins. Have your login bean
throw this exception when the login is invalid. Have your servlet
catch the exception, get the message, and process accordingly.

tim.

> > From: A mailing list for Enterprise JavaBeans development
> > [mailto:[EMAIL PROTECTED]]On Behalf Of SINDHU CHELLAPPA
>
> >     In my application, I would like to send a message like
> > 'Invalid username or password' when a invalid user logs in.The
> > application has a   html which calls a servlet and which in turn
> > calls a BMP entity bean which contacts the database.Now what
> > happens is if the username is not exsisting in the database the
> > ejbload throws the exception and I get a blank screen.Instead I
> > want a message to be flashed on the client screen.How could this
> > be done?
>
> JMS might help you there.
>
> --
> Cedric
> PS: this is hardly EJB related

===========================================================================
To unsubscribe, send email to [EMAIL PROTECTED] and include in the body
of the message "signoff EJB-INTEREST".  For general help, send email to
[EMAIL PROTECTED] and include in the body of the message "help".

Reply via email to