>>> Dominic Tulley <[EMAIL PROTECTED]> 16-Feb-00 11:23:52 AM >>>

> I'm looking for suggestions on how to propagate errors from a
servlet to
>an applet.

Develop a serializable exception, have all your application
exceptions extend that and then when you get one you can serialize it
down the URLConnection's stream.


>I found HttpServletResponse.sendError() but it doesn't really seem
to
>do the job...

No. It's not really meant for that purpose. It could be used though.

Encode the error as a String header field (ie: exception.toString())
and when you get an error response to some HTTP request use:

throw Class.forName(
URLConnection.getHeaderField("error-header-name") ).newInstance();


That will throw an exception with the same name as the one you have
in the header named:
"error-header-name"



Nic Ferrier

___________________________________________________________________________
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