I'm against changing it in this way. Currently all three flavours of
DispatchAction require the parameter to be configured in the
struts-config.xml in order for them to be able to determine which method to
call. Without the parameter none of them can determine the method - thats a
different scenario to them knowing the parameter but being unable to get the
method name or find the method. In the case of MappingDispatchAction where
the parameter is the method name - I think most people would want the
exception thrown.
How about moving the parameter stuff into a separate method that retains
the existing behaviour, but allows people to override to provide a "default"
value if they require?
protected String getParameter() throws ServletException {
// Identify the request parameter containing the method name
String parameter = mapping.getParameter();
if (parameter == null) {
String message =
messages.getMessage("dispatch.handler",
mapping.getPath());
log.error(message);
throw new ServletException(message);
}
return parameter;
}
Niall
----- Original Message -----
From: "Hubert Rabago" <[EMAIL PROTECTED]>
Sent: Saturday, April 30, 2005 12:01 AM
Bugs 16104 and 34663 ask for a default method in DispatchAction. In
both cases, the response has been to use unspecified(). I think the
problem in both cases is the requirement for a mapping.getParameter()
value.
unspecified() only gets called if ActionMapping.parameter is present
but doesn't match any existing methods. If .parameter is null, we
throw a servlet exception [ http://tinyurl.com/9hswq ]. We can easily
change the code so that this requirement goes away, though this might
create compatibility issues.
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]