Return-Path: Delivered-To: apmail-struts-commits-archive@locus.apache.org Received: (qmail 22218 invoked from network); 29 Jun 2006 18:14:22 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (209.237.227.199) by minotaur.apache.org with SMTP; 29 Jun 2006 18:14:22 -0000 Received: (qmail 96109 invoked by uid 500); 29 Jun 2006 18:14:19 -0000 Delivered-To: apmail-struts-commits-archive@struts.apache.org Received: (qmail 96059 invoked by uid 500); 29 Jun 2006 18:14:19 -0000 Mailing-List: contact commits-help@struts.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@struts.apache.org Delivered-To: mailing list commits@struts.apache.org Received: (qmail 96050 invoked by uid 99); 29 Jun 2006 18:14:18 -0000 Received: from asf.osuosl.org (HELO asf.osuosl.org) (140.211.166.49) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 29 Jun 2006 11:14:18 -0700 X-ASF-Spam-Status: No, hits=-0.0 required=10.0 tests=SPF_HELO_PASS X-Spam-Check-By: apache.org Received: from [192.87.106.226] (HELO ajax.apache.org) (192.87.106.226) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 29 Jun 2006 11:14:18 -0700 Received: from ajax.apache.org (localhost [127.0.0.1]) by ajax.apache.org (Postfix) with ESMTP id 0D11E6ACA9 for ; Thu, 29 Jun 2006 19:13:57 +0100 (BST) Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit From: Apache Wiki To: commits@struts.apache.org Date: Thu, 29 Jun 2006 18:13:57 -0000 Message-ID: <20060629181357.25980.77146@ajax.apache.org> Subject: [Struts Wiki] Update of "StrutsManualActionClasses" by MichaelJouravlev X-Virus-Checked: Checked by ClamAV on apache.org X-Spam-Rating: minotaur.apache.org 1.6.2 0/1000/N Dear Wiki user, You have subscribed to a wiki page or wiki category on "Struts Wiki" for change notification. The following page has been changed by MichaelJouravlev: http://wiki.apache.org/struts/StrutsManualActionClasses ------------------------------------------------------------------------------ - '''Attention: this page describes functionality that is not yet available in GA Struts release! Work in progress!''' - - == Action Classes == - The goal of an Action class is to process a request and return an ActionForward object. Action class can either implement a ''stateless service'' like "search", or can manage a logical ''web resource'' like "Customer". !ActionForward object identifies where control should be transferred to provide the appropriate response, and usually designates either another Action (see [:ActionChaining:action chaining]) or a presentation page. Struts is agnostic to presentation technology, so response can be generated using JSP file, Tile definition, Velocity template, XSLT stylesheet or other rendering engine. !ActionForward object represents a logical outcome of processing a request. By not defining a specific menu choice or a page URL it is possible to separate state of a resource from its visual representation. + + Action class handles all incoming requests with one callback method, {{{execute()}}}. Two overloaded versions of this method are available. Choosing one or another depends on your servlet environment: + + {{{public ActionForward execute(ActionMapping mapping, + ActionForm form, + ServletRequest request, + ServletResponse response) + throws Exception; + + public ActionForward execute(ActionMapping mapping, + ActionForm form, + HttpServletRequest request, + HttpServletResponse response) + throws Exception;}}} + + Since the majority of teams using the framework are focused on building web applications, most projects will only use the "!HttpServletRequest" version. A non-HTTP execute() method has been provided for applications that are not specifically geared towards the HTTP protocol. The following picture illustrates a simple "render page" use case implemented with Struts and ASP.NET. In Struts the requests means something like "Process request data and transfer control to a JSP page that corresponds to result of the processing". In ASP.NET the request simply means "Display the page". @@ -30, +42 @@ * If there's more than one response, go to the list page (as per the previous behavior). Note that the code of the search action is not affected by this decision. In Struts the outcomes returned by an action are much more stable than the presentation locations. On contrary, in ASP.NET the outcome is simply the page that was requested. - - Action class handles all incoming requests with one callback method, {{{execute()}}}. Two overloaded versions of this method are available. Choosing one or another depends on your servlet environment: - - {{{public ActionForward execute(ActionMapping mapping, - ActionForm form, - ServletRequest request, - ServletResponse response) - throws Exception; - - public ActionForward execute(ActionMapping mapping, - ActionForm form, - HttpServletRequest request, - HttpServletResponse response) - throws Exception;}}} - - Since the majority of teams using the framework are focused on building web applications, most projects will only use the "!HttpServletRequest" version. A non-HTTP execute() method has been provided for applications that are not specifically geared towards the HTTP protocol. == Action And Web Forms == @@ -119, +115 @@ inline:action_component_generic.gif - Struts 1.4 allows to create web components using Struts Action class for event processing, JSP for presentation and an optional Javascript helper for in-place update in Ajax mode. + Struts 1.4 will allow creating web components using Struts Action class for event processing, JSP for presentation and an optional Javascript helper for in-place update in Ajax mode. See [:StrutsManualActionWebComponent:Developing Web Components With Struts] on using web component manager and code samples.