How to specify error-page for 401?
Hello!We have set up our jboss 4.3 with BasicAuthenticator.
And we protect all of the site area with that.
So if we try to access the app we get a login-form-popup (user and password).
This works fine.
But we also would like to present an certain error-page if the login fails.
So we added the following into our web.xml
<error-page>
<error-code>401</error-code>
<location>/not_autherized.jsp</location>
</error-page>
..but this resulted in that the error-page is shown right away instead of any login-form-popup.
I "guess" the logic inside jboss might work like this then:
access_webapp()
{
try
{
showWebUrl()
}
catch(NotAutherizedExeption nae)
{
if(Error_Page_Spec_In_Web_xml_Exist())
{
showErrorPage()
}
else
{
showBasicAuthirizationPopUp()
}
}
}
If you got any idea how to specify the not_autherized.jsp only if the login fails please let me know!
Best reagrds
Fredrik
