title: How to use AngularJS with Struts 1.x
body: <p>I'm new to AngularJS and client side stuff and I'm adding a new page to an old application that uses Struts 1.3 as its framework.  I would like to use AngularJS for the front end.</p>
  <p>I know how to return JSON from the action class by writing the JSON to the front end and returning <code>null</code> for the action forward.  However, I'm unclear how I would populate the scope variables within the controller after the GET.  If I use a GET in the controller and get JSON back, how does my <code>ActionForm</code> fit into all this?  Is it useful at all?  Can I have a GET and POST for the same controller if I want to send new values back to my action?  And, can I have variables like:</p>
  <pre><code>$scope.items={}
  $scope.items.name=&quot;&quot;
  $scope.items.email=&quot;&quot;
  </code></pre>
  <p>And then just send <code>json.stringify(items)</code> as my data in the POST if I can't use the form somehow?</p>
  <p>I haven't found much information using AngularJS with Struts 1.3 so far.</p>
  <p><strong>EDIT:</strong></p>
  <p>I'll try to answer as best as possible what conclusion I came to but my questions above were very vague since I didn't really know what I was talking about and my position with the company I worked for has ended so I no longer have access to that code.  What I meant to ask earlier was what am I going to do with the action form that I usually use for Struts actions and how am I going to get data from the front end to my action class during a POST.  I found out that my usual <code>ActionfForm</code> was useless for what I wanted to do so I got rid of it and wrote a JSON object during the GET that would be modified on the frontend and passed back to another action when I did the POST.  This is done like a normal POST to <code>whateverAction.do</code>, but I had to configure the data I was sending in the POST and name it something.  I then picked up the modified JSON object by using</p>
  <pre><code>request.getParameter(&quot;jsonObjName&quot;) 
  </code></pre>
  <p>and parsed it to different <code>LinkedHashMap</code> objects for each object in the JSON object.  I think you can use the <code>JSONObject</code> classes instead of <code>LinkedHashMap</code> to parse if you are using JavaEE but I was using SE so I didn't have access to those in this project.  Here a link to another page I used for the POST configurations:</p>
  <p><a href="https://stackoverflow.com/questions/22881922/how-to-get-the-data-in-struts-from-angularjs-post">How to get the data in Struts from AngularJS post</a></p>