zno2

struts.xml action 默认方法和指定方法

https://struts.apache.org/docs/action-configuration.html#ActionConfiguration-ActionMethods

The default entry method to the handler class is defined by the Action interface.

Action interface
public interface Action {
    public String execute() throws Exception;
}

 Implementing the Action interface is optional. If Action is not implemented, the framework will use reflection to look for an execute method.

Sometimes, developers like to create more than one entry point to an Action. For example, in the case of a data-access Action, a developer might want separate entry-points for createretrieveupdate, and delete. A different entry point can be specified by the method attribute.

<action name="delete" class="example.CrudAction" method="delete">
    ...

 If there is no execute method and no other method specified in the configuration the framework will throw an exception.

posted on 2023-06-06 13:13  zno2  阅读(17)  评论(0编辑  收藏  举报

导航