Server-side Script Does Not Seem to Load

Server-side Script Does Not Seem to Load

andrewmorenoandrewmoreno Posts: 10Questions: 0Answers: 0
edited April 2010 in General
Allan, thanks so much for this tool! I am just starting out in my career and I have already seen how DataTables will be a big help.

I recently began using DataTables (successfully - it looks great!), however, I am having to switch from client side to server-side processing because the amount of rows I need to load when first initializing is about 6000 and, unfortunately, since IE 6.0 is still the official browser browser supposed at my company - all of my internal users will be using it and the page takes way too long to load (Chrome works great however).

I was able to follow the example, but my problem seems to be that I can not seem to get the server-side script set in "sAjaxSource" to work. We are using JSP in my department, so I have taken the example that you provided in your script examples page and modified it to my needs. Problem is, I do not think it is even being called, as I put a println on the first line of my JSP to check in my console and it never appears. On my page I just see the tbody row "Loading Data from Server" and at some point the "Processing" message was appearing, but it is currently not.

Below is the code I am using to implement the server-side functionality.
[code]
oTable = $('#example').dataTable( {
"bProcessing": true,
"bServerSide": true,
"sAjaxSource": "../jsp/rmlAjaxSearch.jsp"
} );
[/code]

Do you know of anything else I could be missing to get my script to run? Thanks in advance.

Replies

  • gutzoftergutzofter Posts: 58Questions: 0Answers: 0
    edited May 2010
    maybe it's the location of your jsp page. Your call is from the root of your page.

    if this is your dir structure:
    root --> main_page --> jsp

    you should do this:

    [code]
    "sAjaxSource": "jsp/rmlAjaxSearch.jsp"
    [/code]

    you might want to check in FF firebug to see what is happening to the xhr response.
  • andrewmorenoandrewmoreno Posts: 10Questions: 0Answers: 0
    Thanks gutzofter. I was able to download firebug and found out how to check the response. I discovered what path it was expecting, corrected it, and now I am getting errors that the JSP failed to compile. I have been trying to figure this one out for a little while now, but I'm not sure what is going in.

    Eclipse is now giving me a syntax error stating: "Syntax error, parameterized types are only available if source level is 5.0." The funny thing is, I am definitely using 5.0 as the same line of code is working in plenty of other java classes within my application. This is very odd...anyone have any insight to offer?
  • gutzoftergutzofter Posts: 58Questions: 0Answers: 0
    You might want to try stackoverflow.com for this specific question concerning jsp compile failure
  • andrewmorenoandrewmoreno Posts: 10Questions: 0Answers: 0
    Thanks Gutzofter.

    I was able to discover that it was an issue with the default settings for Websphere WAS 6.1 servers. Although your Java code is being compiled using 1.5 or greater, the configuration files have JSP defaulted to compile using 1.3 compilers. I was able to add a parameter to one of the config files and the table loads nicely now.

    Still having some issues with the filtering, namely that it gets stuck processing on certain sSearch strings. It returns a bad response:

    Error 500: Index: 0, Size: 0

    The parameters passed seem to look ok:
    bEscapeRegex true
    bEscapeRegex_0 true
    bEscapeRegex_1 true
    bEscapeRegex_2 true
    bEscapeRegex_3 true
    bEscapeRegex_4 true
    bEscapeRegex_5 true
    bSearchable_0 true
    bSearchable_1 true
    bSearchable_2 true
    bSearchable_3 true
    bSearchable_4 true
    bSearchable_5 true
    bSortable_0 true
    bSortable_1 true
    bSortable_2 true
    bSortable_3 true
    bSortable_4 true
    bSortable_5 true
    iColumns 6
    iDisplayLength 10
    iDisplayStart 0
    iSortCol_0 0
    iSortingCols 1
    sColumns
    sEcho 5
    sSearch 1000
    sSearch_0
    sSearch_1
    sSearch_2
    sSearch_3
    sSearch_4
    sSearch_5
    sSortDir_0 asc
  • gutzoftergutzofter Posts: 58Questions: 0Answers: 0
    HTTP Error 500 response is a Server error. Look at your server error log to see what happened.

    See: http://en.wikipedia.org/wiki/List_of_HTTP_status_codes#5xx_Server_Error

    For status codes
  • gutzoftergutzofter Posts: 58Questions: 0Answers: 0
    Cursory Google search for [code]Error 500: Index: 0, Size: 0 jsp server[/code]

    IndexOutOfBoundsException seems that your trying to access an array with an index larger than allocated.
  • andrewmorenoandrewmoreno Posts: 10Questions: 0Answers: 0
    Thanks Gutzofter, you have more than helpful. Yes - I just saw this specific error as I was debugging. I see what my issue is. Thanks again for all of your input. I'm sure I may have several other small issues before I get everything working correctly, but I should hopefully be able to figure them out on my own.

    Thanks again!
  • gutzoftergutzofter Posts: 58Questions: 0Answers: 0
    @andrewmoreno,

    De Nada. If there are some problems let us know. I have a meeting from 1-3 this afternoon pacific time, so I won't be available, but go ahead and leave something if you get stuck.
This discussion has been closed.