Results 1 to 3 of 3

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

  1. #1
    Sencha User
    Join Date
    Jul 2013
    Posts
    3
    Vote Rating
    0
      0  

    Default 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 User mitchellsimoens's Avatar
    Join Date
    Mar 2007
    Location
    Gainesville, FL
    Posts
    40,050
    Vote Rating
    1381
      1  

    Default

    Do you have a response in JSON or XML coming from your server side code?
    Mitchell Simoens @LikelyMitch
    Modus Create, Senior Frontend Engineer
    ________________
    Need any sort of Ext JS help? Modus Create is here to help!

    Check out my GitHub:
    https://github.com/mitchellsimoens

  3. #3
    Sencha User
    Join Date
    Jul 2013
    Posts
    3
    Vote Rating
    0
      0  

    Default 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?

Tags for this Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •