If you do not intend to use these integers for calculation, can you just pass to your Javascript as Strings and treat them as Strings in your JS code?
Instead of generating an array of numbers ([6918384653328004118 , 9016587993063058147]
), change your JSP so it wraps your numbers in quotes (["6918384653328004118" , "9016587993063058147"]
). Javascript interprets that as an array of Strings.