Handling HTTP 401 error with JSP

P

Philippe Poulard

Hi,

in my web application, i defined a restrictive area, like this :

<!-- Define a Security Constraint on this Application -->
<security-constraint>
<web-resource-collection>
<web-resource-name>Entire Application</web-resource-name>
<url-pattern>/foo/*</url-pattern>
</web-resource-collection>
<auth-constraint>
<role-name>knownuser<role-name>
</auth-constraint>
</security-constraint>
<!-- Define the Login Configuration for this Application -->
<login-config>
<auth-method>BASIC</auth-method>
<realm-name>myreal</realm-name>
</login-config>
<!-- Security roles referenced by this web application -->
<security-role>
<role-name>knownuser</role-name>
</security-role>

when the browser popups the login window, and the user cancels, the
following message is delivered by the server :

HTTP 401 auth required

i'd like to handle such error server side and use my /error.jsp page instead

how should i do ?
--
Cordialement,

///
(. .)
-----ooO--(_)--Ooo-----
| Philippe Poulard |
-----------------------
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,769
Messages
2,569,579
Members
45,053
Latest member
BrodieSola

Latest Threads

Top