Jquery function to load initial data via ajax

Jquery function to load initial data via ajax

ManiHInManiHIn Posts: 17Questions: 4Answers: 0

Hello,
We use JSP and want to recieve Json data via Axaj call, everything works fine with json, BUT datatable cannot handle our json response. This is our response:
{"data": [{"vorname": "XX","nachname": "XX"},{"vorname": "XX","nachname": "XX"}]}
Datatable response an json invalid error?!?!
Could anyone please help us to solve this problem?
Thanks

This question has an accepted answers - jump to answer

Answers

  • kthorngrenkthorngren Posts: 21,325Questions: 26Answers: 4,949

    The error provides a URL with troubleshooting steps:
    https://datatables.net/manual/tech-notes/1

    That is the place to start. Let us know what you find.

    Kevin

  • ManiHInManiHIn Posts: 17Questions: 4Answers: 0

    Thanks for the link this is my response error

    <!doctype html><html lang="de"><head><title>HTTP Status 500 – Internal Server Error</title><style type="text/css">h1 {font-family:Tahoma,Arial,sans-serif;color:white;background-color:#525D76;font-size:22px;} h2 {font-family:Tahoma,Arial,sans-serif;color:white;background-color:#525D76;font-size:16px;} h3 {font-family:Tahoma,Arial,sans-serif;color:white;background-color:#525D76;font-size:14px;} body {font-family:Tahoma,Arial,sans-serif;color:black;background-color:white;} b {font-family:Tahoma,Arial,sans-serif;color:white;background-color:#525D76;} p {font-family:Tahoma,Arial,sans-serif;background:white;color:black;font-size:12px;} a {color:black;} a.name {color:black;} .line {height:1px;background-color:#525D76;border:none;}</style></head><body>

    HTTP Status 500 – Internal Server Error


    Type Exception Report

    Bescrheibung The server encountered an unexpected condition that prevented it from fulfilling the request.

    Exception

    java.lang.NullPointerException
        com.baumia.control.mitarbeiter.doPost(mitarbeiter.java:61)
        javax.servlet.http.HttpServlet.service(HttpServlet.java:660)
        javax.servlet.http.HttpServlet.service(HttpServlet.java:741)
        org.apache.tomcat.websocket.server.WsFilter.doFilter(WsFilter.java:53)
    

    Hinweis Der komplette Stacktrace der Ursache ist in den Server logs zu finden


    Apache Tomcat/9.0.14

    </body></html>

    Hope you can give any idea.

    Manuel

  • tangerinetangerine Posts: 3,365Questions: 39Answers: 395
    Answer ✓

    "HTTP Status 500 – Internal Server Error" - so check your server's error logs for the details.

  • ManiHInManiHIn Posts: 17Questions: 4Answers: 0

    we solved the problem

    String action = null was the problem, so we set action ="get" and it works nice now
    thank
    Manuel

This discussion has been closed.