Dominic,

We do this in the system we are just completing. We use HTTP tunneling
to send objects between an applet and a servlet. The protocol we use is
that a Message (our own class) object is sent by the applet and it gets
one back in return. If an exception is thrown on the servlet side it is
caught there, bundled into a subclass of Message and sent as the return
object. The applet then uses an instanceof test on the returned object
and if it is an Exception message the exception is extracted and rethrown.
Then the applet deals with the exception as it sees fit.

If you need code for doing the HTTP tunneling then search the archives
as I have posted about it before.

Hope this helps,

Rob Griffin
Quest Software

E-mail: [EMAIL PROTECTED]
Web site: http://www.quest.com

> -----Original Message-----
> From: A mailing list for discussion about Sun Microsystem's Java Servlet
> API Technology. [mailto:[EMAIL PROTECTED]]On Behalf Of
> Dominic Tulley
> Sent: Wednesday, 16 February 2000 22:24
> To: [EMAIL PROTECTED]
> Subject: Error Propogation
>
>
> Hi Folks,
>         I'm looking for suggestions on how to propagate errors
> from a servlet to
> an applet.  The scenario is that the applet opens a URL connection to the
> servlet requesting data - the servlet communicates with EJBs to get the
> info and returns it to the applet.  If there are problems the EJBs raise
> exceptions which the servlet handles.
>
> The question is how can I communicate this to the applet.  If
> need be I can
> simply use known string literals to indicate errors but is there anything
> built in that I have missed?  Can I cause the URL connection at the applet
> side to throw an exception of some kind by calling methods at the servlet
> end?  I found HttpServletResponse.sendError() but it doesn't
> really seem to
> do the job...
>
> Thanks,
>
> -Dominic
>
>
> Dominic Tulley
> Software Engineer
> QSS, Edinburgh
>
> __________________________________________________________________
> _________
> To unsubscribe, send email to [EMAIL PROTECTED] and include
> in the body
> of the message "signoff SERVLET-INTEREST".
>
> Archives: http://archives.java.sun.com/archives/servlet-interest.html
> Resources: http://java.sun.com/products/servlet/external-resources.html
> LISTSERV Help: http://www.lsoft.com/manuals/user/user.html
>

___________________________________________________________________________
To unsubscribe, send email to [EMAIL PROTECTED] and include in the body
of the message "signoff SERVLET-INTEREST".

Archives: http://archives.java.sun.com/archives/servlet-interest.html
Resources: http://java.sun.com/products/servlet/external-resources.html
LISTSERV Help: http://www.lsoft.com/manuals/user/user.html

Reply via email to