Hello, hope you are well.

I´m new to this, I´m testing two days ago Sencha.

My question is very simple.

I am calling a Servlet which returns me a JSON string.

Code:
/ *** @ See HttpServlet # doGet (HttpServletRequest request, HttpServletResponse response)
* /
protected void doGet (HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {
System.out.println ("doGet");
Person person = new Person ();
persona.setId (0);
persona.setNombre ("Cristian");
persona.setApellidoP ("Cruz");
persona.setApellidoM ("Calderón");

Gson GSON = new Gson ();
String json = gson.toJson (person);

response.setContentType ("application / json");
PrintWriter pw = response.getWriter ();
pw.println (json);
pw.close ();
}
Code:
Ext.Ajax.request ({            url: '/ ProyectoSenshaCC / ServletTest'
            params: {
               name: 'hello world'
            }
            success: function (response) {
            alert ("answers" + response.responseText);
            
               
        }})
Until here no problem, I can receive JSON String on the client successfully (and send parameters).

I need trnasform the JSON in a Model, the JSON object represents a TO complex (this is just a test), so I would like to hace this on the client side to manipulate.

The solutions I´ve seen are of the type:

Code:
var cStore = new Ext.data.Store ({autoLoad: true,
proxy: {
type: 'ajax',
url: '/ProyectoSenshaCC/ServletTest'
reader: {
type: 'json'
}
}
, Model: 'Person'
    });
But do not know why I can not get the Servlet (in the documentation, put a url of JSON file, but I need transform the servlet answer.

How I can transform the JSON String in a Model "class"?

Code:
Ext.define ('MyApp.model.Persona', {    extend: 'Ext.data.Model'


    config: {
        fields: [
            {
                name: 'id',
                type: 'int'
            }
            {
                name: 'name',
                type: 'string'
            }
            {
                name: 'apellidoP'
                type: 'string'
            }
            {
                name: 'apellidoM'
                type: 'string'
            }
        ]
    }
});
Sorry for my english, I speak spanish (I´m chilean).

Thank you very much!!!