jQuery UI Widgets Forums General Discussions Odd behaviour when jqx is included in Tomcat9

This topic contains 2 replies, has 2 voices, and was last updated by  Klaus H 3 months, 3 weeks ago.

Viewing 3 posts - 1 through 3 (of 3 total)
  • Author

  • Klaus H
    Participant

    Hi,

    I am using jqwidgets for a couple of years now in Java projects without problems. I have used it with Tomcat 7 in the beginning and Tomcat 8 later. I have tested a project that runs on a Tomcat 8 on a Tomcat 9. Tomcat 9 in standard configuration combined with the newest Firefox generates an error in the browser console “SyntaxError: invalid range in character class” in the file jqxdata.export.js. I have tested this behaviour also with an old portable firefox and also got this message. Same application on Tomcat 8 works fine.

    I have then switched the file and have used the version from the src download, so not minified. I get another error with this: “illegal character” – that seems to be because there is an invisible character before the comment /* tslint:disable */ in line 8. When I delete this character, I get the “invalid range in character class” error again. Unfortunately the browser does not give me a line where this occurs, but I have narrowed it down to the code block that starts in line 3559 and ends in line 3911. When I comment out this section the error is gone and since I have never used the pdf export with jqx that workaround is okay for me right now, but I really wanted to share my findings with you, maybe you can make sense of it and find the cause.

    The bigger problem is, when you include the jqx-all.js, you also get the error and then nothing works.

    Best Regards
    Klaus H


    Peter Stoev
    Keymaster

    Hi Klaus,

    Thanks for the feedback.

    We will have to check about that invisible character for the future releases of our software.

    Regards,
    Peter


    Klaus H
    Participant

    Hello Peter,

    thank you for checking this. I had some time to do more testing and I found the solution for the problem and wanted to share it here.

    The line that caused the problem was: var match = /[а-яА-ЯЁё]/.test(txt);

    The tomcat server switched its behaviour between 8 and 9 and tries to convert static files into a default characterset (despite me saying in the servlet directly and the script tag that includes the javascript file that it is UTF-8).

    But adding the following init-parameter to the default servlet in the web.xml (in server or application) seemed to do the trick:
    <init-param>
    <param-name>fileEncoding</param-name>
    <param-value>utf-8</param-value>
    </init-param>
    Best regards
    Klaus H

Viewing 3 posts - 1 through 3 (of 3 total)

You must be logged in to reply to this topic.