struts 2.2.1 使用注解时action中的方法如何访问?

如,action如下

package org.wdj.jxc.demo.action;

import org.apache.struts2.convention.annotation.Namespace;
import org.wdj.jxc.sys.web.BaseAction;

@Namespace("/test")
public class TestAction extends BaseAction {

/**
 * 
 */
private static final long serialVersionUID = 1L;

public String execute() {
    return SUCCESS;
}

public String list() {
    return SUCCESS;
}

public String json() {
    return JSON;
}

}

访问execute方法时http://127.0.0.1:8080/jxc/test/test.action

但是访问list方法我用2.1.8的方法 http://127.0.0.1:8080/jxc/test/list!test.action

却访问不到list()方法,为什么呢?

struts2.2.1 支持这种访问

list!testAction.action

[quote]The Convention plug-in uses the Action class name to map the action URL. The Convention plug-in first removes the world Action at the end of the class name and then converts the camel case name to dashes. So by default our WelcomeUserAction will be invoked for the request URL welcome-user. But if you want the Action to be invoked for a different URL then you can do this by using the Action annotation.
Convention 插件使用Actin类名来映射器URL。它首先去掉类后面的Action后缀,然后在使用驼峰的地方转换为破折号。所以,默认情况下WelcomeUserAction要通过请求welcome-user来访问。但如果你要让Action使用一个不同的URL来进行,你必须使用Action注解。

The value of the Action annotation is “/welcome”, this means that the action will be invoked for the request URL “/welcome”. You can change the default action and URL mapping using the Action annotation.
Action注解的值为“/welcome”,这意味着这个action将通过/welcome进行访问。你能够通过使用Action注解来改变默认的action和URL映射[/quote]

看了下 官方的帮助文档!(我E 文也不好!纯属盗版 呵呵 凑合着 看看)
好像应该定义一个!
@Action(value="/welcome",results={ @Result(name="success",location="/results/successPage.jsp")})
然后你就知道咋访问了!

http://127.0.0.1:8080/jxc/test/test!list.action 访问list函数 !后面加方法名称