0

I have problem when i deployed on GlassFish: "Uncaught SyntaxError: Invalid or unexpected token".

var ‚”ekiyoMonth    =   GbGetObj(formId, "‚”ekiyoMonth");
        var ‚”ekiyoMonth1 =   GbGetObj(formId, "‚”ekiyoMonth_1");
        var ‚”ekiyoMonth2 =   GbGetObj(formId, "‚”ekiyoMonth_2");
        var ‚”ekiyoMonth5 =   GbGetObj(formId, "‚”ekiyoMonth_5");

        if  (‚”ekiyoMonth.value == null  ||  ‚”ekiyoMonth.value == ""){

            var dsp = GbGetObj(formId, "santeiSaishuMonth_1");

            var rtnAJax = GbSendUserAJax(myClassName,"setTekiyoMonth",dsp.value,null,null,null);

            ‚”ekiyoMonth1.value = rtnAJax[0];
            ‚”ekiyoMonth5.value = rtnAJax[1];
            ‚”ekiyoMonth.value = rtnAJax[2];

            ‚”ekiyoMonth2.value = 0;

and Content-Type: text/javascript;charset=ISO-8859-1. But when i deployed on WebLogic , it works fine. I think the problem is the variables in js files whose name contains full-width characters. How can i change charset ISO-8859-1 to other charset to fix it. Updated: After change response charset, js file cant use in of jsp file and get ERROR 500 Internal Server. This is my jsp code https://yamcode.com/YawSHp2YGh. This is my js code https://yamcode.com/tiQMCnb0gb.

  • This should answer your question: https://stackoverflow.com/questions/6279504/unable-to-change-charset-from-iso-8859-1-to-utf-8-in-glassfish-3-1 – Christoph John Feb 07 '20 at 10:37
  • i try that solution and almost file is convert to new charset but i get new error:"ERR_CONTENT_LENGTH_MISMATCH". Do you have any other solution? –  Feb 10 '20 at 03:57
  • Which of the solutions did you implement? Did you only change the web.xml or did you also use implement the filter described in the link above? – Christoph John Feb 10 '20 at 10:58
  • i change both web.xml and filter. almost file is change to another charset. But some file js get Error 500 Internal Server in GlassFish server and get ERROR_CONTENT_LENGTH_MISMATCH in WebLogic. –  Feb 11 '20 at 00:16
  • Could you add the full strack trace of the 500 Internal Server error to your question? – Christoph John Feb 11 '20 at 10:53
  • i updated my question. You can see code js and jsp in that link. after change charset, it get error in –  Feb 12 '20 at 06:53
  • Could you try removing the second line in your JSP and replace it by this: `<%@ contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%>` – Christoph John Feb 12 '20 at 12:05
  • Nope, it isn't helpful. Nothing change. Do you have other solution? –  Feb 13 '20 at 10:11
  • Did you try adding the UTF-8 encoding to your JS file as well? See https://stackoverflow.com/a/2325092 – Christoph John Feb 13 '20 at 14:24
  • in the code, i uploaded i add encoding Windows-31J and UTF-8 but nothing change. –  Feb 14 '20 at 01:59
  • Sorry, I am afraid I cannot help you further here. – Christoph John Feb 17 '20 at 12:51

0 Answers0