Return-Path: Delivered-To: apmail-tomcat-users-archive@www.apache.org Received: (qmail 150 invoked from network); 25 Feb 2011 19:19:30 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.3) by minotaur.apache.org with SMTP; 25 Feb 2011 19:19:30 -0000 Received: (qmail 38997 invoked by uid 500); 25 Feb 2011 19:19:26 -0000 Delivered-To: apmail-tomcat-users-archive@tomcat.apache.org Received: (qmail 38428 invoked by uid 500); 25 Feb 2011 19:19:25 -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 38221 invoked by uid 99); 25 Feb 2011 19:19:25 -0000 Received: from nike.apache.org (HELO nike.apache.org) (192.87.106.230) by apache.org (qpsmtpd/0.29) with ESMTP; Fri, 25 Feb 2011 19:19:25 +0000 X-ASF-Spam-Status: No, hits=0.7 required=5.0 tests=RCVD_IN_DNSWL_NONE,SPF_NEUTRAL X-Spam-Check-By: apache.org Received-SPF: neutral (nike.apache.org: local policy) Received: from [76.96.59.228] (HELO qmta15.westchester.pa.mail.comcast.net) (76.96.59.228) by apache.org (qpsmtpd/0.29) with ESMTP; Fri, 25 Feb 2011 19:19:16 +0000 Received: from omta18.westchester.pa.mail.comcast.net ([76.96.62.90]) by qmta15.westchester.pa.mail.comcast.net with comcast id CJ201g0021wpRvQ5FKJv7U; Fri, 25 Feb 2011 19:18:55 +0000 Received: from [192.168.1.201] ([69.143.109.145]) by omta18.westchester.pa.mail.comcast.net with comcast id CKJq1g00838FjT13eKJuVX; Fri, 25 Feb 2011 19:18:55 +0000 Message-ID: <4D68009A.5070300@christopherschultz.net> Date: Fri, 25 Feb 2011 14:18:50 -0500 From: Christopher Schultz User-Agent: Mozilla/5.0 (Windows; U; Windows NT 6.1; en-US; rv:1.9.2.13) Gecko/20101207 Thunderbird/3.1.7 MIME-Version: 1.0 To: Tomcat Users List Subject: Re: Response.SendRedirect problems References: <31005032.post@talk.nabble.com> In-Reply-To: X-Enigmail-Version: 1.2a1pre Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit X-Virus-Checked: Checked by ClamAV on apache.org -----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 Konstantin, On 2/25/2011 4:11 AM, Konstantin Kolinko wrote: >>> It concerns the servlet response.sendRedirect(...) method. >>> >>> When using the response.sendRedirect("/myexample") in my java class, i do >>> n= >>> ot want the servlet engine to reconstruct >>> an absolute URL, before sending the response to the browser. > > That is not possible, because of how HTTP spec is written. It's probably not possible using response.sendRedirect, but it should be possible using response.setStatus(302) (or whatever response code you want) and response.setHeader("Location", "/myexample"). Note that this violates the HTTP spec (http://www.w3.org/Protocols/rfc2616/rfc2616-sec14.html#sec14.30) which says that the Location response header is fully-qualified. >> On redirection the port number is getting omitted > > You should describe your configuration in detail first. Though I > think you miss "proxyPort" attribute on a connector. (IIRC, it should > not be necessary for AJP though). Faheem, you can't have a relative "Location" that includes a port number: that will require an absolute (fully-qualified) URI. If Tomcat is incorrectly (or not at all) inserting the port number into the Location field, please let me know. - -chris -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.10 (MingW32) Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org/ iEYEARECAAYFAk1oAJoACgkQ9CaO5/Lv0PDgLQCfQC5cFLCkNogWKxQeuldECaQk +wUAn06iE5pAYxhKA8Nj7eKh3HFbP8BO =ZMum -----END PGP SIGNATURE----- --------------------------------------------------------------------- To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org For additional commands, e-mail: users-help@tomcat.apache.org