You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@struts.apache.org by Ted Husted <hu...@apache.org> on 2001/11/25 04:35:36 UTC

Re: [SUBMIT] LookupDispatchAction - how to handle multiple html:submit buttons

Erik Hatcher wrote:
> - Any particular reason why the "last one wins" in your loading of the key
> mappings?  Ideally there would not be duplicates, but I prefer the first one
> wins (although I have no strong preference, it just seems friendlier to
> allow the first one for some reason).

Given the use-case and the small number of items involved, it didn't
seem worthwhile to check for duplicates.


> - Why use the response.sendError?  I realize this is done elsewhere in
> Struts, but I much prefer to allow exceptions to climb back up and let
> higher layers deal with them if possible, and having it kick back to the JSP
> page and letting the errorPage directive catch it and forward on would be my
> preference.  Therefore I like throwing a ServletException better.  Any other
> pros/cons to either approach?

The Action is the highest layer, and there is no guarantee that there
will be a JSP with an error directive.


> - Any preference to the position of the "key" parameter on the template
> patternered 'perform' method?  I put mine first, and you switched yours to
> last.  I have no preference, just curious on why the switch.

Just the general idea that extensions add on to the end.


-- Ted Husted, Husted dot Com, Fairport NY USA.
-- Custom Software ~ Technical Services.
-- Tel +1 716 737-3463
-- http://www.husted.com/struts/

--
To unsubscribe, e-mail:   <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>


Re: [SUBMIT] LookupDispatchAction - how to handle multiple html:submit buttons

Posted by Erik Hatcher <ja...@ehatchersolutions.com>.
----- Original Message -----
From: "Ted Husted" <hu...@apache.org>
> > preference.  Therefore I like throwing a ServletException better.  Any
other
> > pros/cons to either approach?
>
> The Action is the highest layer, and there is no guarantee that there
> will be a JSP with an error directive.

D'oh.  Yeah, I wasn't really thinking through this fully.  But I still think
throwing a ServletException would give the browser more information although
only really useful for debugging.  Go ahead and morph my class to have the
sendError way.  What is the status of these two base classes now?  Will you,
Ted, refactor the getMethod stuff and commit them?  Or what else is needed
before they are committable?  Also you can go ahead and rearrange the order
of the parameters and put 'key' last in mine to keep it consistent.

I guess that brings up another issue that has probably been brought up
before - extensible logging such that anything logged from a Struts class
would go through a layer that would allow our own logging to be plugged into
it rather than just logging to the server log.  Or is there already a way to
do that?

Thanks,
    Erik



--
To unsubscribe, e-mail:   <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>