Return-Path: Delivered-To: apmail-struts-dev-archive@www.apache.org Received: (qmail 45497 invoked from network); 31 Aug 2006 22:55:33 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (209.237.227.199) by minotaur.apache.org with SMTP; 31 Aug 2006 22:55:33 -0000 Received: (qmail 89279 invoked by uid 500); 31 Aug 2006 22:55:28 -0000 Delivered-To: apmail-struts-dev-archive@struts.apache.org Received: (qmail 88675 invoked by uid 500); 31 Aug 2006 22:55:26 -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 88664 invoked by uid 99); 31 Aug 2006 22:55:26 -0000 Received: from asf.osuosl.org (HELO asf.osuosl.org) (140.211.166.49) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 31 Aug 2006 15:55:26 -0700 X-ASF-Spam-Status: No, hits=0.5 required=10.0 tests=DNS_FROM_RFC_ABUSE,SPF_PASS X-Spam-Check-By: apache.org Received-SPF: pass (asf.osuosl.org: domain of paulus.benedictus@gmail.com designates 64.233.166.182 as permitted sender) Received: from [64.233.166.182] (HELO py-out-1112.google.com) (64.233.166.182) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 31 Aug 2006 15:55:25 -0700 Received: by py-out-1112.google.com with SMTP id d80so907610pyd for ; Thu, 31 Aug 2006 15:55:04 -0700 (PDT) DomainKey-Signature: a=rsa-sha1; q=dns; c=nofws; s=beta; d=gmail.com; h=received:message-id:date:from:reply-to:user-agent:mime-version:to:subject:references:in-reply-to:content-type:content-transfer-encoding:sender; b=G8VqI+dHgVpp/STaNvK8Q5qfwBZXpAuUasRT90HktScv2jb3lHP3w46bYSoV87+zJiDbdbwIAxw/9iGFThUWlOiureIZ0kxJt3PP8bsIrCdXRaVyACQuo6TmOP61BP/IucB1TlQN0Rv9ub1JJ6hldveOpmYa0btRBrFmarpyyuo= Received: by 10.35.119.11 with SMTP id w11mr1589257pym; Thu, 31 Aug 2006 15:55:04 -0700 (PDT) Received: from ?192.168.11.2? ( [65.30.71.168]) by mx.gmail.com with ESMTP id 12sm3183724nzn.2006.08.31.15.55.04; Thu, 31 Aug 2006 15:55:04 -0700 (PDT) Message-ID: <44F768CB.5030103@apache.org> Date: Thu, 31 Aug 2006 17:55:07 -0500 From: Paul Benedict Reply-To: pbenedict@apache.org User-Agent: Thunderbird 1.5.0.5 (Windows/20060719) MIME-Version: 1.0 To: Struts Developers List Subject: Re: [user-question] Forward back to the page you came from References: <200608301516.20905.tha@qualiads.de> <44F63284.8010609@apache.org> <200608311109.34418.tha@qualiads.de> In-Reply-To: <200608311109.34418.tha@qualiads.de> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 8bit Sender: Paul Benedict X-Virus-Checked: Checked by ClamAV on apache.org X-Spam-Rating: minotaur.apache.org 1.6.2 0/1000/N I have actions like this: forwards to edit displays page forwards to previous page If you think about what these mappings are, they are really actions (functions) of a person page. You go to a page to view a person and then you use the page to save a person. loadPerson and savePerson are what I call business actions. Because they perform some heavy operation and then forward off to some view. My editPerson is an action specifically for viewing data; it takes data already loaded and saves it. Which of these would be "pages"? only editPerson, imo, since it's purpose is to render data. You should read Michael's article on it. It's excellent http://today.java.net/pub/a/today/2005/08/04/jspcomponents.html?page=1 Paul Thomas Hamacher wrote: > Paul, > > thank you very much for your answer... but let me ask you for a few more > details: > I understood that I need a separation between simple pages and the pages, that > do some business logic and that I should do that through an additional > property in the ActionMappings of the struts-config. > But where would I receive this ActionMapping and where should I save it? > Furthermore is there a way to save an ActionMapping in a page? How to do that? > > I would be very thankful if you could give me some more information about your > idea. It sounds very interesting but I don�t really know what to do yet.. > > Thanks a lot > > Thomas > > Am Donnerstag, 31. August 2006 02:51 schrieb Paul Benedict: >> About a month ago I recommend this same thing. The problem really is >> that Struts has no concept of a page, so it's impossible to tell the >> difference between actions that perform business logic and actions that >> just front rendering of a page. >> >> You really need a page-based framework to make this happened. My >> personal recommendation was to include a "page" property on each action >> mapping which you consider a page. Then in the controller, the last URI >> can be tracked if this attribute is present in the action mapping. I >> really recommend this approach to you. >> >> It's such a custom solution though that I couldn't recommend it to be >> included into the Struts Framework. If Struts ever does involve into a >> page-based controller, then there is leverage to do such a thing... but >> at the present time you can totally emulate what you need by what I said >> above. >> >> Paul >> >> Thomas Hamacher wrote: >>> Dear everyone, >>> >>> after spending a lot of time with googling and multiple tries with >>> different approaches and also my questions to the struts-user-mailinglist >>> didn�t come to a solution, I would like to as you guys if there is a way >>> or not. So I�m sorry, if I use the developers-list for a stupid >>> user-question, but I don�t know any place else I might find a solution to >>> this problem: >>> >>> My question is: Does the struts-framework provide a possibility to >>> forward back to the page you came from? >>> >>> I can�t believe, that I�m the only one, who has this problem and I don�t >>> think there is no struts-conform solution. Let me give you the following >>> scenarios so that you know what I�m talking about. >>> - I wanna show a login-box on every page. If the user logs into the >>> webpage, the login-action executes and afterwards the user is redirected >>> to the page he has been before, but the userMenu is displayed instead the >>> login-box. If the authorization fails, he�ll be redirected to the same >>> page, showing im an error-message >>> - On top of every page is a possibility to change the language through >>> clicking on a button with a language-flag. After changing the locale, the >>> user will be redirected back to the page he came from, but using a >>> different language. >>> >>> These are only 2 examples to get an idea, what I�m talking about. I tried >>> the following: >>> >>> - using the referrer from the request. But this could not be a solution, >>> as it is not struts-conform and there are many possibilities, that the >>> referrer might not be availabe >>> - using the ActionMapping-Object�s input-Value. This doesn�t work >>> together with tiles, as the input-value is only part of the tile, but I >>> need the information of the "parent"-tile. Furtermore this doesn�t work >>> if the last action was a ForwardAction. Other attributes in the >>> mapping-object only refer to the next page, but not the current page. >>> - saving the last ActionForward in the session. This does only work, if >>> the user uses one browser-window and does never use the back-button, >>> because otherwise he�ll be redirected to an unexpected page. >>> - saving the tiles-definition in a hidden field on the jsp-page. This >>> would prevent the problem with the unexpected page, but does only work, >>> if a form will be submitted, that has a hidden-field with this value. Or >>> is there a way to put a parameter into the request without submitting a >>> form and without adding it to the URI. >>> - Adding a forward to every ActionMapping and extend the BaseAction to >>> forward to a specified forward. This won�t work, because of tiles as >>> well. Unfortunately you never know, which pages include this tile, so you >>> can�t use a static forward. >>> >>> So I�d expect a solution somewhere near the RequestProcessor, but >>> especially with the ComposableRequestProcessor, this goes very deep into >>> the struts-architecture. I�m open to do this, but I don�t know the place >>> where to look at. >>> Is there a way I haven�t looked at or does anyone have an idea how to >>> solve this, as you probably know the struts-processes a lot better than I >>> do. Or is there a special reason, that this could not be implemented into >>> the struts-framework because of technically restrictions? >>> >>> I�d greately appriciate any help to this topic. Sorry for asking this >>> question in the developers-list again, but I don�t know any other place >>> to ask for a solution, as I could not get any information to solve this >>> problem. >>> >>> I hope, someone knows a solution to this or might share some ideas. >>> >>> Many thanks >>> >>> Thomas >>> >>> --------------------------------------------------------------------- >>> 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