struts-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Rick Reumann <>
Subject Re: DispatchAction defaults
Date Mon, 28 Mar 2005 18:26:31 GMT
Nic Werner wrote the following on 3/28/2005 1:06 PM:
> I view the unspecified() method as the equivalent to 'index.jsp'. I 
> deliberately put an index.jsp (or html) in the directory to provide the 
> correct output, as opposed to leaving it unhandled - I see Struts and 
> unspecified() as a mirror of this.

I don't really get the index.jsp comparison to unspecified?

Regardless, the reason I don't like using unspecified is two-fold:

1) The unspecified method is simply vague. Granted, this is by design, 
but in reality 'unspecified' will do 'something' so why not make it 
clear what you are going to do so it's easier for developers to quickly 
pick up on what the method implementation provides. All unspecified does 
is save you from having to provide a dispatch parameter on your front 
end, which to me doesn't save that much coding and instead makes things 

2) It could potentially lead to some unexpected behavior. What if on a 
page, you happened to forget to provide a dispatch parameter that you 
really intended to have? Your action would still get called and the 
unspecified method would be invoked. This could lead to the application 
working, but not as expected. I'd rather it break right away since it 
couldn't find the appropriate method name.

Granted, other people like the unspecified method, so it's not that big 
of a deal and I like that Struts provides the option for those that want 
to take advantage of it. For me, it's just a matter of coding preference.


To unsubscribe, e-mail:
For additional commands, e-mail:

View raw message