Return-Path: X-Original-To: apmail-struts-dev-archive@www.apache.org Delivered-To: apmail-struts-dev-archive@www.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id 358BFDD7E for ; Wed, 26 Sep 2012 18:01:48 +0000 (UTC) Received: (qmail 65452 invoked by uid 500); 26 Sep 2012 18:01:47 -0000 Delivered-To: apmail-struts-dev-archive@struts.apache.org Received: (qmail 65382 invoked by uid 500); 26 Sep 2012 18:01:47 -0000 Mailing-List: contact dev-help@struts.apache.org; run by ezmlm Precedence: bulk List-Unsubscribe: List-Help: List-Post: List-Id: "Struts Developers List" Reply-To: "Struts Developers List" Delivered-To: mailing list dev@struts.apache.org Received: (qmail 65374 invoked by uid 99); 26 Sep 2012 18:01:47 -0000 Received: from nike.apache.org (HELO nike.apache.org) (192.87.106.230) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 26 Sep 2012 18:01:47 +0000 X-ASF-Spam-Status: No, hits=-0.7 required=5.0 tests=RCVD_IN_DNSWL_LOW,SPF_PASS X-Spam-Check-By: apache.org Received-SPF: pass (nike.apache.org: domain of fredricus@gmail.com designates 74.125.82.176 as permitted sender) Received: from [74.125.82.176] (HELO mail-we0-f176.google.com) (74.125.82.176) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 26 Sep 2012 18:01:39 +0000 Received: by weyz53 with SMTP id z53so185686wey.35 for ; Wed, 26 Sep 2012 11:01:19 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :content-type; bh=CEv/Mn6Y+wpA/6vAo/hlNX5SeSTKJuBhYjMwk6tAM5w=; b=fe/vED86FXsC/K52uReRp5UDJAms5rsyHlTgTDBmM2cyKxBCjPQC43EG0k1TCQKpHr O8L4B7DsMGAZayJ5PWuJuqbfbQ+2ZkzgTzS2YXFeAdkP8ZR2PvIIVr6HmhEI3bdpeEk0 BE/EUnBRJohwADuJ3RYY10Xknx33b41VLHNElubwYuJDrImDGezpcwR0yJFPN/NEhj+w NgonJ4n/LmlMlfHMN0gzJX4LFdgPOq+D6CVIRbARn1PIL0C0dIoavdc+5Q4XljHzgeLz dDdatrDNPQ0vN78LOS0AQHOw5GqKLKE3SjfajeT6zxhx9Wcg0nsuxIL7nYA0AsrRgf2D kJTA== MIME-Version: 1.0 Received: by 10.216.237.25 with SMTP id x25mr92192weq.30.1348682479651; Wed, 26 Sep 2012 11:01:19 -0700 (PDT) Received: by 10.194.24.193 with HTTP; Wed, 26 Sep 2012 11:01:19 -0700 (PDT) In-Reply-To: References: Date: Wed, 26 Sep 2012 21:01:19 +0300 Message-ID: Subject: Re: Redirect-action alternative in Struts2 without browser redirect From: Fredrik Lindberg To: Struts Developers List Content-Type: text/plain; charset=ISO-8859-1 Hi! Well, by "presentational side" I meant the side of the server logic where you have already determined what view to pass to the client. In the setup I have, every action has its own JSP for rendering itself, but sometimes I have a need to call a different action instead of rendering that corresponding JSP. Currently this is done via redirects, which as far as I have read is nothing unusual. What I would like to do now is replace the redirect with a direct call to the following action. Is there no way to do this and in that case why? I have been thinking of creating a new ResultType, but this seems like standard functionality. / Fredrik Lindberg (2012-09-26). On Wed, Sep 26, 2012 at 8:39 PM, Chris Pratt wrote: > If you're configuring this in struts.xml, you're not in the browser (i.e. > presentation side), you're in the server! You either need to stream the > results directly from the server using one of the direct rendering engines > (jsp/freemarker/velocity/tiles) or you need to redirect to another URL or > Action. Maybe you need to take a step back and lay out exactly what you're > trying to accomplish. > (*Chris*) > > On Wed, Sep 26, 2012 at 10:15 AM, Fredrik Lindberg wrote: > >> Hi! >> >> Yes, but then we are already on the presentation side of things. I >> want to forward to a different action and have it execute without a >> browser redirect. >> >> / Fredrik Lindberg (2012-09-26) >> >> On Wed, Sep 26, 2012 at 7:45 PM, Chris Pratt >> wrote: >> > The default jsp/freemarker/velocity/tiles results do send the response >> > directly. The redirect & redirect-action results do exactly as you'd >> > expect and redirect the browser to retrieve the response. >> > (*Chris*) >> > >> > On Wed, Sep 26, 2012 at 9:30 AM, Fredrik Lindberg > >wrote: >> > >> >> Hi! >> >> >> >> I am looking for if there is any alternative to the redirect-action >> >> result type where it does not generate a browser redirect? The issue >> >> with the browser redirect is that it results in a longer response >> >> times for the users and also means the server is put under higher load >> >> when it has to handle two requests in rapid succession (noticeable >> >> under high load). Also why not send what the client wants right away? >> >> >> >> I have read about request chaining and using the ChainingInterceptor, >> >> but this is fundamentally wrong in the sense that all request >> >> parameters that the first action was fed also are passed on to the >> >> next action. What I want is having control over what properties are >> >> passed on to the next action in the same way as for the redirects, but >> >> without the overhead. Can anyone help? =) >> >> >> >> / Fredrik Lindberg (2012-09-26). >> >> >> >> --------------------------------------------------------------------- >> >> To unsubscribe, e-mail: dev-unsubscribe@struts.apache.org >> >> For additional commands, e-mail: dev-help@struts.apache.org >> >> >> >> >> >> --------------------------------------------------------------------- >> To unsubscribe, e-mail: dev-unsubscribe@struts.apache.org >> For additional commands, e-mail: dev-help@struts.apache.org >> >> --------------------------------------------------------------------- To unsubscribe, e-mail: dev-unsubscribe@struts.apache.org For additional commands, e-mail: dev-help@struts.apache.org