I'm running jboss-3.2.7 and need to use a custom 401 error page with my servlets. But by doing so, I don't get a dialog box asking me to authenticate and it immediately errors out and displays the custom 401 page. If I comment out the following from my web.xml,
<error-page> <error-code>401</error-code> <location>/unauth.jsp</location> </error-page>
resp.setHeader("WWW-Authenticate", "Basic realm=\"" + realmName + "\""); resp.sendError(HttpServletResponse.SC_UNAUTHORIZED);