Return-Path: Delivered-To: apmail-struts-user-archive@www.apache.org Received: (qmail 71693 invoked from network); 2 Sep 2009 13:59:14 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.3) by minotaur.apache.org with SMTP; 2 Sep 2009 13:59:14 -0000 Received: (qmail 86215 invoked by uid 500); 2 Sep 2009 13:59:11 -0000 Delivered-To: apmail-struts-user-archive@struts.apache.org Received: (qmail 86163 invoked by uid 500); 2 Sep 2009 13:59:11 -0000 Mailing-List: contact user-help@struts.apache.org; run by ezmlm Precedence: bulk List-Unsubscribe: List-Help: List-Post: List-Id: "Struts Users Mailing List" Reply-To: "Struts Users Mailing List" Delivered-To: mailing list user@struts.apache.org Received: (qmail 86153 invoked by uid 99); 2 Sep 2009 13:59:11 -0000 Received: from athena.apache.org (HELO athena.apache.org) (140.211.11.136) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 02 Sep 2009 13:59:11 +0000 X-ASF-Spam-Status: No, hits=0.0 required=10.0 tests=SPF_PASS,UNPARSEABLE_RELAY X-Spam-Check-By: apache.org Received-SPF: pass (athena.apache.org: local policy) Received: from [76.13.13.45] (HELO smtp106.prem.mail.ac4.yahoo.com) (76.13.13.45) by apache.org (qpsmtpd/0.29) with SMTP; Wed, 02 Sep 2009 13:59:02 +0000 Received: (qmail 25459 invoked from network); 2 Sep 2009 13:58:40 -0000 DomainKey-Signature: a=rsa-sha1; q=dns; c=nofws; s=s1024; d=yahoo.com; h=Received:X-Yahoo-SMTP:X-YMail-OSG:X-Yahoo-Newman-Property:Message-ID:Date:From:User-Agent:MIME-Version:To:Subject:References:In-Reply-To:Content-Type:Content-Transfer-Encoding; b=Fur2w0Wmb+JQcYlBgU7wrtp/1wWA/DhP7aoucjzY/ssZnDtxxWMoLJoYwY8ADJU6gcKyeFVf4oaxICGTk6ZNME4OZ1117WycjPw/bktTMzuGmmTYQgwasdqr+G8XCtlIAzxeo9m005Z2HFUZlbKfKgLhAH+aL+b19YArcnhmO2w= ; Received: from c-98-235-247-104.hsd1.nj.comcast.net (newton.dave@98.235.247.104 with plain) by smtp106.prem.mail.ac4.yahoo.com with SMTP; 02 Sep 2009 06:58:40 -0700 PDT X-Yahoo-SMTP: viQwDh.swBAQoPAzQ_OSzULegiPpFTdw X-YMail-OSG: 3BDWoBUVM1k8LU86b3d3XOKhmsqDxKe6A7ryUy8RvcBdwQgDrTbAfKFBbOZAJNtDdieGgcN8AkD6j_ZeR24Zvd0Aj7KZNSfN6pMcVJ02YFw39VP3a6DKRBvg0Sn30sVfDN8Rs_DspqPPSJki3LOGxOBfFR2WJm2FHSdM5leD4MW3c37AkU05M3umfZU3J0bu3N8zjJCZ23ZMG5HaJK2.dcvq1iuWJcYq7E2X4nITrbWMhpRAKASUIlCfLSPUm9l4K6EKSy2uDE8oNhsIfVaC.Wur0K2D0Tm_zG98yTr_F2EVpx6etTAJGA_uGCKatnPsB1wC9e04 X-Yahoo-Newman-Property: ymail-3 Message-ID: <4A9E7A10.5040807@yahoo.com> Date: Wed, 02 Sep 2009 09:58:40 -0400 From: Dave Newton User-Agent: Thunderbird 2.0.0.23 (Macintosh/20090812) MIME-Version: 1.0 To: Struts Users Mailing List Subject: Re: httpheader result type References: <25254438.post@talk.nabble.com> <25257727.post@talk.nabble.com> 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 FWIW, I did a quick dispatcher result hack that allows setting the HTTP result; we use it for Ajax calls (not 404s). I'll probably fold that property back into S2, but like Wes said it's not so handy for 404s. Dave Wes Wannemacher wrote: > 404 is a tricky header... Most of the time, you really don't want to > send content along with an http header, think of redirects, etc. If > you want some app-specific behavior, I would try to fit it into your > app rather than trying to munge headers. In the case of redirects, > when you see content it is because the redirect is happening with > either meta-refresh or javascript. When the web server sends a 302 (or > whatever the number), you don't see anything but a blank page (or the > previously loaded page) in the browser. One nifty trick I have seen is > to go to a "landing" page that has a meta-refresh who's target is > redirected... Not sure how that is better, but my brain nearly > exploded when I tried to figure out what was going on. > > What makes 404 tricky is that it is a header that is often associated > with content, since no one likes to see the stock > apache/tomcat/jetty/whatever error pages. The saving grace here is > that you can use web.xml in a container-nonspecific way to create a > 404 page. If what you're looking for is to pretty-up the 404 page, use > web.xml and skip any of the struts configuration. If you are looking > to incorporate 404 into some sort of application-specific logic, make > sure that's *really* what you want to do first, then if so, check one > more time before you do it, then after that, that is when you'll want > to try to code up your solution. > > -Wes > > On Wed, Sep 2, 2009 at 9:33 AM, Mark Rollins wrote: >> Thanks Wes. >> >> The 'documentation' (it's very limited) gives the impression that you can >> specify an error message when using the errorMessage parameter with the >> error parameter, and even being able to pick up a message from the value >> stack using an OGNL expression. >> >> Having looked at what is returned (firebug in firefox), I can see no mention >> of the error and the content (as you said) is empty. >> >> -- >> View this message in context: http://www.nabble.com/httpheader-result-type-tp25254438p25257727.html >> Sent from the Struts - User mailing list archive at Nabble.com. >> >> >> --------------------------------------------------------------------- >> To unsubscribe, e-mail: user-unsubscribe@struts.apache.org >> For additional commands, e-mail: user-help@struts.apache.org >> >> > > > --------------------------------------------------------------------- To unsubscribe, e-mail: user-unsubscribe@struts.apache.org For additional commands, e-mail: user-help@struts.apache.org