Return-Path: X-Original-To: apmail-tomcat-users-archive@www.apache.org Delivered-To: apmail-tomcat-users-archive@www.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id 6117BEE3E for ; Tue, 26 Feb 2013 19:04:18 +0000 (UTC) Received: (qmail 79484 invoked by uid 500); 26 Feb 2013 19:04:14 -0000 Delivered-To: apmail-tomcat-users-archive@tomcat.apache.org Received: (qmail 79408 invoked by uid 500); 26 Feb 2013 19:04:14 -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 79398 invoked by uid 99); 26 Feb 2013 19:04:14 -0000 Received: from athena.apache.org (HELO athena.apache.org) (140.211.11.136) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 26 Feb 2013 19:04:14 +0000 X-ASF-Spam-Status: No, hits=1.0 required=5.0 tests=SPF_SOFTFAIL X-Spam-Check-By: apache.org Received-SPF: softfail (athena.apache.org: transitioning domain of terence@tmbsw.com does not designate 208.82.204.51 as permitted sender) Received: from [208.82.204.51] (HELO secure.builders-agent.com) (208.82.204.51) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 26 Feb 2013 19:04:06 +0000 Received: from [127.0.0.1] (adsl-208-191-157-48.dsl.hstntx.swbell.net [208.191.157.48]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by tmbsw.com (Postfix) with ESMTP id 0C975201C0 for ; Tue, 26 Feb 2013 13:03:45 -0600 (CST) Message-ID: <512D0719.7080001@tmbsw.com> Date: Tue, 26 Feb 2013 13:03:53 -0600 From: "Terence M. Bandoian" User-Agent: Mozilla/5.0 (Windows NT 5.1; rv:14.0) Gecko/20120713 Thunderbird/14.0 MIME-Version: 1.0 To: Tomcat Users List Subject: Re: Tomcat6 j_security_check any parameter / sessions variable on failure? References: In-Reply-To: Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-Virus-Checked: Checked by ClamAV on apache.org On 2/25/2013 2:54 AM, Tanmoy Chatterjee wrote: > Hello, > Tech Stack: > Tomcat: 6.0.35 > Java: 1.6.0_18 > OS: RHEL 5.3 > > I am using j_security_check (JNDIRealm - LDAP authentication). > On failure I am sending the user to a common error.jsp in the application. On successful authentication of-course the page requested is displayed. > The problem is that the error.jsp is called from the application as well if there are any errors/ exceptions in some functionality (I want to avoid writing any new error pages in my application). > > In the error.jsp, is there any way to know that the failure is because of j_security_check and not from anywhere else i.e does tomcat add any separate sessions parameter after unsuccessful j_security_check authentication which I can use for displaying proper error message? > > Thanks, > Tanmoy Hi, Tanmoy- javax.servlet.error.request_uri is one attribute that is set on the request. Further information is available here: http://tomcat.apache.org/tomcat-6.0-doc/api/constant-values.html Also, I'd suggest taking a look at the Error Handling chapter in the Java Servlet Specification. -Terence Bandoian --------------------------------------------------------------------- To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org For additional commands, e-mail: users-help@tomcat.apache.org