-1

This code has been removed since it can be copyrighted and is not allowed to do it without any permissions

Thrillofit123
  • 195
  • 1
  • 2
  • 12
  • Thank you @Basilevs for the correction! :) – Thrillofit123 Oct 19 '15 at 09:18
  • If you ask for help in conversion, provide a sample of input data. – Basilevs Oct 19 '15 at 09:18
  • What's Sparks? Is it http://sparkjava.com/ ? – Basilevs Oct 19 '15 at 09:21
  • Yes sir, Spark is that! – Thrillofit123 Oct 19 '15 at 09:21
  • Then, its irrelevant, remove Spark from the title. Also consider removing Java, it is already present in question tags. – Basilevs Oct 19 '15 at 09:22
  • What's your suggestion as title? Since I need at least 15 characters – Thrillofit123 Oct 19 '15 at 09:24
  • Why are you doing this by hand? Spring MVC or Jersey will handle the translation for you automatically. – chrylis -cautiouslyoptimistic- Oct 19 '15 at 09:26
  • @chrylis well this seems to be a regular client application, spring and jersey tend to live in web applications. As such this question is more tailored towards doing manual json serialization/deserialization. – Gimby Oct 19 '15 at 09:28
  • I have no idea what they are, Could you explain more what you meant? – Thrillofit123 Oct 19 '15 at 09:28
  • @Gimby, Jersey has client library too. – Basilevs Oct 19 '15 at 09:29
  • And Spring has RestTemplate. – chrylis -cautiouslyoptimistic- Oct 19 '15 at 09:33
  • @Thrillofit123 true enough. But in my own defense, that doesn't change the fact that this question is not about using pre-built RESTful webservice clients even though we can probably all agree that would be a good idea ;) – Gimby Oct 19 '15 at 09:45
  • You can see that you'll get JSON from TMDB http://docs.themoviedb.apiary.io/#reference/search/searchmovie/get - with spark as your web server, what are you trying to serve? Html or JSON? There is an odd mix of `
    ` in the string you're serving but no other `` structure. There are btw tons of working implementations of the API and you don't have to roll your own: https://www.google.com/search?q=tmdb+java
    – zapl Oct 19 '15 at 09:45
  • So first I want to receive it as JSON because my plan is later on in the project to take those information from my Java classes to my HTML by using the JSON information. I thought it was simple where I could just create everything on Java and just make it easier to HTML but it didn't go as I wanted. So yeah, What I want to do now is to make it as JSON only and what I'm going to do with HTML will I take another time. – Thrillofit123 Oct 19 '15 at 09:53

1 Answers1

0

I suspect your problem is result conversion. From your search* methods you return a string, losing all JSON structure in the process. Return JSON object instead. Consider using Jackson pretty writer to output it.

Community
  • 1
  • 1
Basilevs
  • 22,440
  • 15
  • 57
  • 102