title: struts2-json-plugin not retrieving json data from action class for Struts-JQuery-Plugin grid
body: <p>Im having an issue getting json working with the struts-jquery-plugin-2.1.0</p>
  
  <p>I have included the struts2-json-plugin-2.1.8.1 in my classpath as well.
  Im sure that I have my struts-jquery-plugin configured correctly because the grid loads, but doesnt load the data its supposed to get from the action class that has been json'ized.</p>
  
  <p>The documentation with the json plugin and the struts-jquery plugin leaves ALOT of gaps that I cant even find with examples/tutorials, so I come to the community at stackoverflow.</p>
  
  <p>My action class has a property called gridModel thats a List with a basic POJO called Customer. Customer is a pojo with one property, id.
  I have a factory that supplies the populated List to the actions List property which i mentioned called gridModel.</p>
  
  <p>Heres how i set up my struts.xml file:</p>
  
  <p></p>
  
  <pre><code>&lt;constant name="struts.devMode" value="true"/&gt;
  &lt;constant name="struts.objectFactory" value="guice"/&gt;
  
  &lt;package name="org.webhop.ywdc" namespace="/" extends="struts-default,json-default"&gt;
  
  &lt;result-types&gt;
      &lt;result-type name="json" class="com.googlecode.jsonplugin.JSONResult"&gt;
  
      &lt;/result-type&gt;
  &lt;/result-types&gt;
      &lt;action name="login" class="org.webhop.ywdc.LoginAction" &gt;
  
              &lt;result type="json"&gt;&lt;/result&gt;
              &lt;result name="success" type="dispatcher"&gt;/pages/uiTags/Success.jsp&lt;/result&gt;
             &lt;result name="error" type="redirect"&gt;/pages/uiTags/Login.jsp&lt;/result&gt;
              &lt;interceptor-ref name="cookie"&gt;
                  &lt;param name="cookiesName"&gt;JSESSIONID&lt;/param&gt;
              &lt;/interceptor-ref&gt;
      &lt;/action&gt;
      &lt;action name="logout" class="org.webhop.ywdc.LogoutAction" &gt;
  
             &lt;result name="success" type="redirect"&gt;/pages/uiTags/Login.jsp&lt;/result&gt;
      &lt;/action&gt;
  &lt;/package&gt;
  </code></pre>
  
  <p></p>
  
  <p>In the struts.xml file i set the 
  
  and in my action i listed 
  
  in the action configuration.</p>
  
  <p>Heres my jsp page that the action loads:</p>
  
  
  
  
  
  
  
  
  
      
           
          Welcome, you have logged in!
    
      
  
       
  
          
          
  
      
  
       Welcome, you have logged in. <br />
      <b>Session Time: </b>
  
  <pre><code>  &lt;h2&gt;Password:&lt;s:property value="password"/&gt;&lt;/h2&gt;
  
    &lt;h2&gt;userId:&lt;s:property value="userId"/&gt;&lt;/h2&gt;
    &lt;br /&gt;
    &lt;a href="&lt;%= request.getContextPath() %&gt;/logout.action"&gt;Logout&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;
   ID: &lt;s:property value="id"/&gt;
   session id: &lt;s:property value="JSESSIONID"/&gt;
  
  &lt;/body&gt;
  </code></pre>
  
  <p></p>
  
  <p>Im not really sure how to tell what json the json plugin is creating from the action class.
  If i did know how i could tell if it wasnt formed properly.
  As far as I know if I specificy  in my action configuration
  in struts.xml, that the grid, which is set to read json and knows to look for "gridModel" will then automatically load the json to the grid, but its not.</p>
  
  <p>Heres my action class:</p>
  
  <p>public class LoginAction extends ActionSupport {</p>
  
  <pre><code>  public String JSESSIONID;
    public int id;
    private String userId;
    private String password;
    public Members member;
    public List&lt;Customer&gt; gridModel;
  
    public String execute()
    {
              Cookie cookie = new Cookie("ywdcsid", password);
              cookie.setMaxAge(3600);
              HttpServletResponse response = ServletActionContext.getResponse();
              response.addCookie(cookie);
  
              HttpServletRequest request = ServletActionContext.getRequest();
              Cookie[] ckey = request.getCookies();
              for(Cookie c: ckey)
              {
                  System.out.println(c.getName() + "/cookie_name + " + c.getValue() + "/cookie_value");
              }
              Map requestParameters = ActionContext.getContext().getParameters();//getParameters();
              String[] testString = (String[])requestParameters.get("password");
              String passwordString = testString[0];
              String[] usernameArray = (String[])requestParameters.get("userId");
              String usernameString = usernameArray[0];
  
              Injector injector = Guice.createInjector(new GuiceModule());
              HibernateConnection connection = injector.getInstance(HibernateConnection.class);
              AuthenticationServices currentService = injector.getInstance(AuthenticationServices.class);
              currentService.setConnection(connection);
              currentService.setInjector(injector);
              member = currentService.getMemberByUsernamePassword(usernameString, passwordString);
              userId = member.getUsername();
              password = member.getPassword();
  
              CustomerFactory customerFactory = new CustomerFactory();
              gridModel = customerFactory.getCustomers();
  
              if(member == null)
              {
                  return ERROR;
              }
              else
              {
                  id = member.getId();
                  Map session = ActionContext.getContext().getSession();
                  session.put(usernameString, member);
                  return SUCCESS;
              }   
    }
  
      public String logout() throws Exception 
      {
          Map session = ActionContext.getContext().getSession();
          session.remove("logged-in");
          return SUCCESS;
      }
      public List&lt;Customer&gt; getGridModel()
      {
          return gridModel;
      }
      public void setGridModel(List&lt;Customer&gt; gridModel)
      {
          this.gridModel = gridModel;
      }
      public String getPassword() 
      {
          return password;
      }
  
      public void setPassword(String password) 
      {
          this.password = password;
      }
  
      public String getUserId() 
      {
          return userId;
      }
  
      public void setUserId(String userId) 
      {
          this.userId = userId;
      }
      public String getJSESSIONID() {
          return JSESSIONID;
      }
  
      public void setJSESSIONID(String jsessionid) {
          JSESSIONID = jsessionid;
      }
  
  }
  </code></pre>
  
  <p>Please help me with this problem. You will make my week, as this is a major
  bottleneck for me :(</p>
  
  <p>thanks so much,</p>
  
  <p>thebravedave</p>