"Booth, Peter" wrote:
> Is there a "standard mechanism" for returning both
> a serialized object and optional out-of-band numeric error
> codes from a servlet?
>
> I have seen examples of code where a servlet sets
> a respones error code:
>
> e.g.
> res.sendError(res.SC_INTERNAL_SERVER_ERROR);
>
> Is there any way that an applet can check for
> such an error code before reading from a URLConnection's
> input stream?
>
In your applet, you can cast the URLConnection to an HttpURLConnection (since
you used an "http" URL to contact the servlet). Now, you can call the
getResponseCode() method to retrieve the HTTP status code set by the servlet.
>
> Peter Booth
> [EMAIL PROTECTED]
>
Craig McClanahan
___________________________________________________________________________
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