Return-Path: Delivered-To: apmail-tomcat-users-archive@www.apache.org Received: (qmail 3308 invoked from network); 25 Apr 2006 11:02:41 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (209.237.227.199) by minotaur.apache.org with SMTP; 25 Apr 2006 11:02:41 -0000 Received: (qmail 65921 invoked by uid 500); 25 Apr 2006 11:02:03 -0000 Delivered-To: apmail-tomcat-users-archive@tomcat.apache.org Received: (qmail 65895 invoked by uid 500); 25 Apr 2006 11:02:03 -0000 Mailing-List: contact users-help@tomcat.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: "Tomcat Users List" Delivered-To: mailing list users@tomcat.apache.org Received: (qmail 65884 invoked by uid 99); 25 Apr 2006 11:02:03 -0000 Received: from asf.osuosl.org (HELO asf.osuosl.org) (140.211.166.49) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 25 Apr 2006 04:02:03 -0700 X-ASF-Spam-Status: No, hits=-0.0 required=10.0 tests=SPF_PASS X-Spam-Check-By: apache.org Received-SPF: pass (asf.osuosl.org: domain of David.Delbecq@oma.be designates 193.190.231.71 as permitted sender) Received: from [193.190.231.71] (HELO bonnie.oma.be) (193.190.231.71) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 25 Apr 2006 04:02:02 -0700 Received: from [193.190.249.120] (bonnie.oma.be [193.190.231.71]) by bonnie.oma.be (8.11.1 (Revision 1.5) /8.11.1) with ESMTP id k3PB1eI23082 for ; Tue, 25 Apr 2006 11:01:40 GMT Message-ID: <444E016B.1070603@oma.be> Date: Tue, 25 Apr 2006 13:00:59 +0200 From: David Delbecq User-Agent: Mozilla Thunderbird 1.0.7 (X11/20051017) X-Accept-Language: fr, en MIME-Version: 1.0 To: Tomcat Users List Subject: Re: Tomcat 5.0 : how to "redirect" a 401 error to a specific page References: In-Reply-To: Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 8bit X-Virus-Checked: Checked by ClamAV on apache.org X-Spam-Rating: minotaur.apache.org 1.6.2 0/1000/N See section 10.4.2 of http://www.w3.org/Protocols/rfc2616/rfc2616-sec10.html You have to understand the page user see when he hit cancel has been send by tomcat before the user hit cancel. This is the page which is shown to user to indicate him he requires authentification. If you want to customize the layout of this page, use the way, but do not, in you page send any redirect as it will break authentification mecanism (the browser won't get it's 401 header and thus won't show the http auth dialog to user). Francis Galiegue a �crit : >Hello, > >Our webapp runs with Tomcat 5, Apache 2.0.46 from RHEL3, Tomcat 5.0.27 >from JPackage, and communicate via mod_jk 1.2.6. > >Here's the problem we face: our webapp sends notifications by email, >with a link to a JSP requiring a classical HTTP authentication dialog. >This same page is used for the login form into the application, and >its behaviour is controlled by the parameters passed to it. > >When the user DOES NOT submit any information (ie, it presses "Cancel" >on the dialog box), Tomcat shows its 401 page. I've tried the >following: > >* add an ErrorDocument directive to Apache config: no go; >* add an tag with and into the > section of WEB-INF/web.xml with the location pointing back >to the same page, with no parameters: no go either... It's even worse >in this case, since the Tomcat 401 page shows directly, the HTTP auth >dialog doesn't even appear. > >I haven't tried _both_ at the same time, but I believe it wouldn't be >the solution. > >As I'm not really fluent with Apache/Tomcat and webapps, I don't know >where I should look at to solve the problem. Any hints would be more >than welcome! > >Thanks for reading, and it'd be nice to reply-all, since the two CC >are not on the list, >-- >Francis Galiegue, fgaliegue@gmail.com, fg@one2team.com, fg6@wanadoo.fr >One2team - 12bis rue de la Pierre Lev�e, 75011 Paris - 0143381980 >"When it comes to performance, weight is everything" - Tiff Needell > >--------------------------------------------------------------------- >To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org >For additional commands, e-mail: users-help@tomcat.apache.org > > > --------------------------------------------------------------------- To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org For additional commands, e-mail: users-help@tomcat.apache.org