I reply to myself, because I have found the answer and I think it's better
to remark it.

In the BaseAction.java (under src/web.action) the method "execute" handle
URLs without parameter ("method" for default): if the URL contains (and NOT
only begins with) the words "edit", "save" or "view" it will call
respectively the methods "edit", "save" or "search". Clearly if you have an
URL called /view.html and you specify the "method" parameter, you'll have
what you are expeting; this note is true only for URL without "method"
parameter specified.

 

 

Follow up my question:

 

Hi all,

I have a newbie struts question for you: to choose an Action method to
execute from a jsp is ALWAYS needed to specify the method=<methodname>
parameter when calling the Action path (i.e. users.html).

I know that there is a default called by the "unspecified" method, and I
know that adding the method parameter always works. 

But I have found in some points that calling only the path without method
parameter works! But only in some special cases I think, because I have made
many tests and searched through the code but I have found nothing that could
help me.

 

Thank you

Fabrizio

 

Reply via email to