sgzwiz / jsonplugin

Automatically exported from code.google.com/p/jsonplugin
0 stars 1 forks source link

I can not get json-data If i use struts2.1.6's CoC #85

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
What steps will reproduce the problem?
1. Use the struts2.1.6's CoC to config the struts action class like this:
@SuppressWarnings("serial")
@ParentPackage("json-default")
@Namespace("/common")
public class User2Action extends SimpleActionSupport {
    @Override
    public String execute() throws Exception {
        return SUCCESS;
    }

    @Action(interceptorRefs={@InterceptorRef
("paramsPrepareParamsStack"),@InterceptorRef("defaultStack")},results=
{@Result(type="json", name = "")})
    public String test() throws Exception {
        name = "HELLO AMU";
        return null;
    }
    private String name="amu";

    @JSON(name="ISBN")
    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }

}
2.To request the http://locahost:8080/amu/common/user2!test.action
3.The Server can get the request, but the web-client get nothing
4.If i use XML to config struts actions.then, i can get the wrapped data

What is the expected output? What do you see instead?
I expected output the json-wrapped data,but I get nothing if I use 
struts2.1.6's CoC

What version of the product are you using? On what operating system?
Struts2.1.6 jsonplugin0.33,and OS is windowXP

Please provide any additional information below.

Original issue reported on code.google.com by 147175...@163.com on 3 Mar 2009 at 1:51

GoogleCodeExporter commented 9 years ago
It'a my fault. just the @Result property 'name' should have a value, and the 
method 
under it should return a String as same as the @Result name's value,

Original comment by 147175...@163.com on 17 Mar 2009 at 9:40

GoogleCodeExporter commented 9 years ago

Original comment by musa...@gmail.com on 28 Jul 2009 at 6:12