Le 14/08/2012 14:59, Marvin Addison a écrit :
<error-page>
<error-code>401</error-code>
<location>/WEB-INF/view/jsp/err401.jsp</location>
</error-page>

And I wrote the matching jsp, but no luck... I always get the tomcat default
error page ?? Any idea ?
The above web.xml configuration should be sufficient to specify a
custom error page.  You might try to turn up internal Tomcat logging
to see if you get more information on the view resolution process.
Maybe it can't find the path or something.
switched debug logging within tomcat with no luck, on tomcat side, I only have :

DEBUG [org.apache.coyote.ajp.AjpMessage] - Received 630 18
DEBUG [org.apache.catalina.connector.CoyoteAdapter] - The variable [uriBC] has value [/cas35/login]
DEBUG [org.apache.catalina.connector.CoyoteAdapter] - The variable [semicolon] 
has value [-1]
DEBUG [org.apache.catalina.connector.CoyoteAdapter] - The variable [enc] has value [ISO-8859-1]
DEBUG [org.apache.tomcat.util.http.Cookies] - Cookies: Parsing b[]: 
JSESSIONID=xxx;
DEBUG [org.apache.catalina.connector.CoyoteAdapter] -  Requested cookie session 
id is yyyy
DEBUG [org.apache.catalina.authenticator.AuthenticatorBase] - Security checking request GET /cas35/login
DEBUG [org.apache.catalina.realm.RealmBase] -   No applicable constraints 
defined
DEBUG [org.apache.catalina.authenticator.AuthenticatorBase] -  Not subject to 
any constraint
DEBUG [org.apache.tomcat.util.http.Parameters] - Set encoding to UTF-8
DEBUG [org.apache.tomcat.util.http.Parameters] - Decoding query null null
DEBUG [org.apache.tomcat.util.http.Parameters] - Start processing with input [service=http%3A%2F%2Fdev.miletrie.chl%2Fphilippe%2Feclipse%2Ftestcas%2Fwww%2Fcas35.php]

And CAS 3.5.0 side :

DEBUG [org.springframework.web.servlet.DispatcherServlet] - <DispatcherServlet with name 'cas' processing GET request for [/cas35/login]> DEBUG [org.springframework.web.servlet.DispatcherServlet] - <Last-Modified value for [/cas35/login] is: -1> DEBUG [org.springframework.beans.factory.support.DefaultListableBeanFactory] - <Creating instance of bean 'org.jasig.cas.authentication.principal.UsernamePasswordCredentials'> DEBUG [org.springframework.beans.factory.support.DefaultListableBeanFactory] - <Finished creating instance of bean 'org.jasig.cas.authentication.principal.UsernamePasswordCredentials'> DEBUG [org.springframework.beans.factory.support.DefaultListableBeanFactory] - <Returning cached instance of singleton bean 'initialFlowSetupAction'> DEBUG [org.jasig.cas.web.support.CasArgumentExtractor] - <Extractor generated service for: http://dev.miletrie.chl/philippe/eclipse/testcas/www/cas35.php> DEBUG [org.springframework.beans.factory.support.DefaultListableBeanFactory] - <Returning cached instance of singleton bean 'generateLoginTicketAction'> DEBUG [org.springframework.beans.factory.support.DefaultListableBeanFactory] - <Returning cached instance of singleton bean 'negociateSpnego'> DEBUG [org.jasig.cas.support.spnego.web.flow.SpnegoNegociateCredentialsAction] - <Authorization header not found. Sending WWW-Authenticate header> DEBUG [org.springframework.beans.factory.support.DefaultListableBeanFactory] - <Returning cached instance of singleton bean 'spnego'> DEBUG [org.springframework.web.servlet.DispatcherServlet] - <Null ModelAndView returned to DispatcherServlet with name 'cas': assuming HandlerAdapter completed request handling>
DEBUG [org.springframework.web.servlet.DispatcherServlet] - <Successfully 
completed request>

After a look in involved class SpnegoNegociateCredentialsAction, I'm wondering about this line (82) :
response.setStatus(HttpServletResponse.SC_UNAUTHORIZED);

In setStatus' javadoc, there's a word about sendError method that should be called in order to process an error page defined in the web application, isn't that why my custom error page is not displayed ?

Regards.

--
Philippe MARASSE

Service Informatique - Centre Hospitalier Henri Laborit
BP 587 - 370 avenue Jacques Coeur
86021 Poitiers Cedex
Tel : 05.49.44.57.19


Attachment: smime.p7s
Description: Signature cryptographique S/MIME

Reply via email to