Coder Social home page Coder Social logo

Error parsing large files about jsonview HOT 5 CLOSED

bhollis avatar bhollis commented on July 17, 2024
Error parsing large files

from jsonview.

Comments (5)

bhollis avatar bhollis commented on July 17, 2024

Do you know if Firefox itself will parse that JSON (using JSON.parse)?

from jsonview.

bhollis avatar bhollis commented on July 17, 2024

Hmm, I can't reproduce this. I generated the JSON you described (with 318 instances of {"text":"There is an issue with the path"}) and it rendered fine. It works just as well with 3,180 instances.

from jsonview.

dabraham02124 avatar dabraham02124 commented on July 17, 2024

I don't know how to ask firefox to use JSON.parse. I'm more than willing to test it if you can point me in the right direction.

Is there a way to turn on debugging or something so that jsonview will say "firefox isn't doing its part, aborting" or something?

And hmm, When I saw a coworker have the same issue (on a different OS and everything) I thought for sure it wasn't just me. Well, I mean, it isn't just me, but I thought it meant it was nigh universal. But not for you. I wonder why not. I've tried this before, but I'll try to be a bit more rigorous getting a clean firefox, installing this one extension, and seeing what happens.

Thank you very much.

from jsonview.

bhollis avatar bhollis commented on July 17, 2024

Just open the JS console or Firebug, put your JSON in a string, and call JSON.parse on it.

If you have the actual JSON file, that might help me debug it - I tried making one like you describe, but it didn't work. You can just post it as a Gist.

from jsonview.

dabraham02124 avatar dabraham02124 commented on July 17, 2024

I figured it out. Sorry, it's not a jsonView thing, it's a servlet thing.

I replaced this:
PrintWriter writer = response.getWriter();
writer.println(json);
response.setContentType("application/json");

with this:
response.setContentType("application/json");
PrintWriter writer = response.getWriter();
writer.println(json);

over 16K characters it will chunk the response and send the first chunk down while letting the servlet do other things to the HttpServletResponse. So you have to set the type before you write the response.

This is NOT a bug in jsonView, but it should probably be mentioned in a faq or something.

Again, thank you very much.

from jsonview.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.