1. #1
    Sencha User
    Join Date
    Jul 2013
    Posts
    3
    Vote Rating
    0
    terrorrmg is on a distinguished road

      0  

    Default Data display using GridPanel from database using Hibernate - Servlet Backend

    Data display using GridPanel from database using Hibernate - Servlet Backend


    Hi,
    I am beginner in Ext JS. I want to display datas from database in gridpanel using Hibernate and Servlet. In many tutorials they explain with PHP. But I want to implement using Servlets and Hibernate FrameWork. Please Help me.

  2. #2
    Sencha - Senior Forum Manager mitchellsimoens's Avatar
    Join Date
    Mar 2007
    Location
    Gainesville, FL
    Posts
    37,546
    Vote Rating
    873
    mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute

      1  

    Default


    Do you have a response in JSON or XML coming from your server side code?
    Mitchell Simoens @SenchaMitch
    Sencha Inc, Senior Forum Manager
    ________________
    Check out my GitHub, lots of nice things for Ext JS 4 and Sencha Touch 2
    https://github.com/mitchellsimoens

    Think my support is good? Get more personalized support via a support subscription. https://www.sencha.com/store/

    Need more help with your app? Hire Sencha Services services@sencha.com

    Want to learn Sencha Touch 2? Check out Sencha Touch in Action that is in print!

    When posting code, please use BBCode's CODE tags.

  3. #3
    Sencha User
    Join Date
    Jul 2013
    Posts
    3
    Vote Rating
    0
    terrorrmg is on a distinguished road

      0  

    Default Data display using GridPanel from database using Hibernate - Servlet Backend: Reply

    Data display using GridPanel from database using Hibernate - Servlet Backend: Reply


    Quote Originally Posted by mitchellsimoens View Post
    Do you have a response in JSON or XML coming from your server side code?
    Thanks for your suggestion . I searched for JSON as you told and arrived at the following code. Now its showing an exception as
    'java.lang.ClassCastException: mypack.UserBean cannot be cast to [Ljava.lang.Object;'

    Pls Note : The listOfXrefInfo has the list of users (Checked in debug)

    List<Object[]> listOfXrefInfo;
    listOfXrefInfo = ub.getListOfUsers(); //Getting list of users from database
    JSONObject objResulJson = new JSONObject();
    JSONArray objJSONArray = new JSONArray();
    JSONObject objJsonRow = null;
    Object[] rows=null;

    for (int index = 0; index < size; index++) {

    rows=listOfXrefInfo.get(index);
    objJsonRow = new JSONObject();
    objJsonRow.put("userid", rows[0]);
    objJsonRow.put("username",rows[1]);
    objJsonRow.put("mailid",rows[2]);
    objJsonRow.put("role", rows[3]);


    objJSONArray.put(objJsonRow);
    }
    objResulJson.put("result", objJSONArray);
    objResulJson.put("totalCount", listOfXrefInfo.size());


    out.println(objResulJson);


    Why am i getting this error? Is there any other way out?