title: Problem with Json plugin in Struts 2
body: <p>I have the following code and I would to achieve functionality that /getJson will return user object as json and /getJson2 will return user2 as Json object.</p>
  
  <pre><code>@ParentPackage("json-default")
  public class JsonAction extends ActionSupport{
  private User user = new User("John","Smith"); 
  private User user2 = new User("Smith","John"); 
  public String populate(){
  
      return "populate";
  }
  
  @Action(value="/getJson", results = {
          @Result(name="success", type="json")})
  public String test(){
      return "success";
  }
  
  @Action(value="/getJson2", results = {
          @Result(name="success", type="json")})
  public String test2(){
      return "success";
  }
  
  @JSON(name="user")
  public User getUser() {
      return user;
  }
  
  public void setUser(User user) {
      this.user = user;
  }
  
  @JSON(name="user2")
  public User getUser2() {
      return user2;
  }
  
  public void setUser2(User user2) {
      this.user2 = user2;
  }
  }
  </code></pre>
  
  <p>Currently no matter which method I'm calling I'm still getting the following result:</p>
  
  <pre><code>{"user":{"firstName":"John","lastName":"Smith"},"user2":{"firstName":"Smith","lastName":"John"}}
  </code></pre>
  
  <p>Is it possible?</p>
  
  <p><strong>Update:</strong></p>
  
  <p>I modified the code:</p>
  
  <pre><code>public class JsonAction extends ActionSupport{
  private User user = new User("John","Smith"); 
  private User user2 = new User("Smith","John"); 
  public String populate(){
  
      return "populate";
  }
  
  @Action(value="/getJson", results = {
          @Result(name="success", type="json",params = {
                  "includeProperties",
                  "user"})})
  public String test(){
      return "success";
  }
  
  @Action(value="/getJson2", results = {
          @Result(name="success", type="json",params = {
                  "includeProperties",
                  "user2"})})
  public String test2(){
      return "success";
  }
  
  @JSON(name="user")
  public User getUser() {
      return user;
  }
  
  public void setUser(User user) {
      this.user = user;
  }
  
  @JSON(name="user2")
  public User getUser2() {
      return user2;
  }
  
  public void setUser2(User user2) {
      this.user2 = user2;
  }
  }
  </code></pre>
  
  <p>Now I'm getting </p>
  
  <pre><code>{"user":{}}
  </code></pre>
  
  <p>and </p>
  
  <pre><code>{"user2":{}}
  </code></pre>