users@glassfish.java.net

401 Unauthorized when failing security constraint of servlet?

From: Gabor Szokoli <szocske_at_gmail.com>
Date: Sun, 13 Jul 2008 09:58:56 +0200

Hi,

I have a servlet with a security constraint in its web.xml deployed on
GlassFish.
Works great, clients with a trusted certificate can access the
servlet, and those without see nothing (no response).

But I'd like to play nice and respond with a 401 Unauthorized instead
of an empty response to those without, how can I do that?
(I do not want to provide a custom error-page, in fact I don't care
about the body at all, just the response code.)


Thanks in advance:

Gabor Szokoli