Return-Path: Delivered-To: apmail-jakarta-struts-dev-archive@apache.org Received: (qmail 73172 invoked from network); 1 Aug 2003 13:40:33 -0000 Received: from exchange.sun.com (192.18.33.10) by daedalus.apache.org with SMTP; 1 Aug 2003 13:40:33 -0000 Received: (qmail 8958 invoked by uid 97); 1 Aug 2003 13:43:09 -0000 Delivered-To: qmlist-jakarta-archive-struts-dev@nagoya.betaversion.org Received: (qmail 8950 invoked from network); 1 Aug 2003 13:43:09 -0000 Received: from daedalus.apache.org (HELO apache.org) (208.185.179.12) by nagoya.betaversion.org with SMTP; 1 Aug 2003 13:43:09 -0000 Received: (qmail 72552 invoked by uid 500); 1 Aug 2003 13:40:25 -0000 Mailing-List: contact struts-dev-help@jakarta.apache.org; run by ezmlm Precedence: bulk List-Unsubscribe: List-Subscribe: List-Help: List-Post: List-Id: "Struts Developers List" Reply-To: "Struts Developers List" Delivered-To: mailing list struts-dev@jakarta.apache.org Received: (qmail 72541 invoked from network); 1 Aug 2003 13:40:25 -0000 Received: from web20704.mail.yahoo.com (216.136.226.177) by daedalus.apache.org with SMTP; 1 Aug 2003 13:40:25 -0000 Message-ID: <20030801134027.35017.qmail@web20704.mail.yahoo.com> Received: from [32.97.110.142] by web20704.mail.yahoo.com via HTTP; Fri, 01 Aug 2003 06:40:27 PDT Date: Fri, 1 Aug 2003 06:40:27 -0700 (PDT) From: David Graham Reply-To: dgraham@apache.org Subject: Re: Addition of two new actions To: Struts Developers List In-Reply-To: MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Spam-Rating: daedalus.apache.org 1.6.2 0/1000/N X-Spam-Rating: daedalus.apache.org 1.6.2 0/1000/N --- Steve Raeburn wrote: > I'd like to add two new actions to org.apache.struts.actions that I find > particularly useful. > > 1. SuccessAction - A simple action that forwards control to an > ActionFoward > named "success". > > This is a very simple action, but I find it exceptionally useful, > particularly in the early stages of development when it can act as a > placeholder for as-yet undeveloped actions. > > public ActionForward execute( > ActionMapping mapping, > ActionForm form, > HttpServletRequest request, > HttpServletResponse response) > throws Exception { > > ActionForward forward = mapping.findForward("success"); > if (forward == null) { > String message = > messages.getMessage("success.required", mapping.getPath()); > log.error(message); > throw new ServletException(message); > } > return forward; > } I'm not a big fan of Struts hardcoding things like forward names or message keys in the standard distro. We shouldn't be dictating that type of thing. Why can't you use a ForwardAction to acheive this type of functionality? > > 2. ParameterDispatchAction - A DispatchAction that selects a handler > method > using the value of the ActionMapping parameter. > > This is as per the suggestion by Anthony Kay via Bugzilla > , except I > prefer > the name ParameterDispatchAction to his suggestion of > ConfigDispatchAction > as I think it's more descriptive of what the class actually does. Other > than > the name change, I've just tidied up the Javadoc and changed the > 'unspecified' method to throw an Exception (as in DispatchAction) rather > than return an Http error code. I have no problems with this one. I don't currently use DispatchAction but is there a way the proposed behavior could be included with that class instead of a new one? David > > If no one has any problems with adding these two, I'll put them in > tomorrow. > > > Steve > > > > --------------------------------------------------------------------- > To unsubscribe, e-mail: struts-dev-unsubscribe@jakarta.apache.org > For additional commands, e-mail: struts-dev-help@jakarta.apache.org > __________________________________ Do you Yahoo!? Yahoo! SiteBuilder - Free, easy-to-use web site design software http://sitebuilder.yahoo.com --------------------------------------------------------------------- To unsubscribe, e-mail: struts-dev-unsubscribe@jakarta.apache.org For additional commands, e-mail: struts-dev-help@jakarta.apache.org