我使用如下方法创建了一个操作:
public class NomenclatureAction extends ActionSupport {
// ...
@Actions({
@Action(value = "ajaxDoStuff",
results = {
@Result(name = ActionSupport.SUCCESS, location = "success.jsp"),
@Result(name = ActionSupport.INPUT, location = "fail.jsp")
}),
@Action(value = "index.action",
results = {
@Result(name = ActionSupport.SUCCESS, location = "success.jsp"),
@Result(name = ActionSupport.INPUT, location = "fail.jsp")
})
})
public final String doStuff() {
// ...
return ActionSupport.SUCCESS;
}
}
我想doStuff
使用以下 URL 之一调用相同的方法:
- http://my-server.com/public/namespace/ajaxDoStuff
- http://my-server.com/public/namespace/ajaxDoStuff.action
- http://my-server.com/public/namespace/index
- http://my-server.com/public/namespace/index.action
到目前为止,它适用于前两个 URL,但不适用于后两个。
我错过了什么?