// Path: yet-another-storm-ui-server/src/main/java/com/deepnighttwo/yasu/model/Person.java
// public class Person {
//     String name;
//     String phoneNumber;
// 
//     public String getName() {
//         return name;
//     }
// 
//     public void setName(String name) {
//         this.name = name;
//     }
// 
//     public String getPhoneNumber() {
//         return phoneNumber;
//     }
// 
//     public void setPhoneNumber(String phoneNumber) {
//         this.phoneNumber = phoneNumber;
//     }
// }


import com.deepnighttwo.yasu.model.Person;
import com.google.gson.Gson;
import javax.servlet.ServletException;
import javax.servlet.annotation.WebServlet;
import javax.servlet.http.HttpServlet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import java.io.IOException;
import java.util.Random;
package com.deepnighttwo.yasu.servlet;



/**
 * User: mzang
 * Date: 2014-08-26
 * Time: 19:54
 */

@WebServlet(name = "angularjsajax", urlPatterns = {"/angularjsajax"})
public class AngularJSAjax extends HttpServlet {

    Gson gson = new Gson();

    @Override
    protected void doPost(HttpServletRequest req, HttpServletResponse resp) throws ServletException, IOException {
        doGet(req, resp);
    }

    @Override
    protected void doGet(HttpServletRequest req, HttpServletResponse resp) throws ServletException, IOException {
        resp.setHeader("Access-Control-Allow-Origin", "*");
        resp.setHeader("Access-Control-Allow-Methods", "GET,POST,PUT,DELETE,OPTIONS");
        resp.setHeader("Access-Control-Allow-Headers", "Content-Type,X-Requested-With");

        int size = 9;
        Random random = new Random();
// Path: yet-another-storm-ui-server/src/main/java/com/deepnighttwo/yasu/model/Person.java
// public class Person {
//     String name;
//     String phoneNumber;
// 
//     public String getName() {
//         return name;
//     }
// 
//     public void setName(String name) {
//         this.name = name;
//     }
// 
//     public String getPhoneNumber() {
//         return phoneNumber;
//     }
// 
//     public void setPhoneNumber(String phoneNumber) {
//         this.phoneNumber = phoneNumber;
//     }
// }


// Path: yet-another-storm-ui-server/src/main/java/com/deepnighttwo/yasu/servlet/AngularJSAjax.java
import com.deepnighttwo.yasu.model.Person;
import com.google.gson.Gson;
import javax.servlet.ServletException;
import javax.servlet.annotation.WebServlet;
import javax.servlet.http.HttpServlet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import java.io.IOException;
import java.util.Random;

package com.deepnighttwo.yasu.servlet;



/**
 * User: mzang
 * Date: 2014-08-26
 * Time: 19:54
 */

@WebServlet(name = "angularjsajax", urlPatterns = {"/angularjsajax"})
public class AngularJSAjax extends HttpServlet {

    Gson gson = new Gson();

    @Override
    protected void doPost(HttpServletRequest req, HttpServletResponse resp) throws ServletException, IOException {
        doGet(req, resp);
    }

    @Override
    protected void doGet(HttpServletRequest req, HttpServletResponse resp) throws ServletException, IOException {
        resp.setHeader("Access-Control-Allow-Origin", "*");
        resp.setHeader("Access-Control-Allow-Methods", "GET,POST,PUT,DELETE,OPTIONS");
        resp.setHeader("Access-Control-Allow-Headers", "Content-Type,X-Requested-With");

        int size = 9;
        Random random = new Random();
        Person[] persons = new Person[size];