struts-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Benjamin Tomasini <btomas...@neteverything.com>
Subject Re: Addition of two new actions
Date Fri, 01 Aug 2003 15:06:19 GMT
On Fri, 2003-08-01 at 10:21, David Graham wrote:
> --- Benjamin Tomasini <btomasini@neteverything.com> wrote:
> > To the end of making it accessible to newcomers, what about making a
> > "samples" directory for actions?  Maybe even forms?
> 
> That type of thing doesn't belong in the Struts core code, it belongs in
> the sample applications.
> 
> David

Of course...

./src/share
./src/samples <-- here

Having it out of the wars will make it more accessible to users.  I know
there are many ways of distributing samples.  In the wars, Struts
project at sf.net, Ted has his own university projects.

Perhaps putting sample actions into the user guide, the making a
separate samples directory, would be nice.

Just some ideas.

Ben

> 
> > 
> > On Fri, 2003-08-01 at 06:19, Ted Husted wrote:
> > > I use many utilities Actions like these, and the result is that fewer 
> > > *custom* Actions are needed. I think increasing the number of standard
> > 
> > > Actions in the distribution is a very good idea. It makes Struts more 
> > > accessible to newcomers, saves everyone from reimplementing the same 
> > > design, and leverages the fact that Actions are singletons.
> > > 
> > > -Ted.
> > > 
> > > Vic Cekvenich wrote:
> > > > I think less actions are needed, not more.
> > > > .V
> > > > 
> > > > 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;
> > > >>     }
> > > >>
> > > >> 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
> > > >> <http://nagoya.apache.org/bugzilla/show_bug.cgi?id=17117>, 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.
> > > >>
> > > >> 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
> > > > 
> > > > 
> > -- 
> > Benjamin Tomasini <btomasini@neteverything.com>
> > NetEverything, Inc.
> > 
> > 
> > ---------------------------------------------------------------------
> > 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
-- 
Benjamin Tomasini <btomasini@neteverything.com>
NetEverything, Inc.


---------------------------------------------------------------------
To unsubscribe, e-mail: struts-dev-unsubscribe@jakarta.apache.org
For additional commands, e-mail: struts-dev-help@jakarta.apache.org


Mime
View raw message