Hi,
In my opinion default method has to be used when the parameter is
specified but the value in the http request is not specified or it
doesn't correspond to a method defined in the action.
Can happen that developers need to collapse some method calls in the
default method call. So I don't think the solution is related to
unspecified, but is in getMethod. If the the method called it doesn't
exist look if in the action if default method is specified and if it
doesn't return a string not null, invoke that. So it means in dispatch
action we need to define a method protected that return null. It can
be overwritten in the developer action. If it returns a string not
null use this value when the value for the parameter it's not
specified or the method invoked doesn't exist.It's handy for the
dispatch to avoid to define many methods with the same content
Bye 

On 4/30/05, Niall Pemberton <[EMAIL PROTECTED]> wrote:
> I'm against changing it in this way. Currently all three flavours of
> DispatchAction to be callto be carequire 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]
> 
> 


-- 
               Graag gedaan 
_____________________________
Giovanni Santini
EDS Italy
ABN-AMRO Working Capital OLS
Loc: Kostverlorenhof 2  AK8000
1183HE Amstelveen (Amsterdam)
The Netherlands
Mobile:  +31 (0) 652245333
Tel:  +31 (0) 203437771
Fax: +31 (0) 206299404

---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to