10

I am looking into Java (possibly Scala) for a project that will use Ember and ember-data. I know I can write a backend to format the JSON, but I was wondering if there are any Java packages for Java more capable for building the JSON strings in a format that will utilize the DS.RESTAdapter more effectively without building something completely custom?

Something similar to Rails Active Model Serializers would be ideal, or a JSON serializer and a replacement REST adapter for Ember.

Just asking you all before I need to build something from scratch. Thanks!

5
  • You know jackson.codehaus.org? Commented Jun 6, 2013 at 17:34
  • I have not been a Java dev for about 10 years, so I am very much out of the loop. I have seen JAX-RS mentioned, and the basic toJSON(), also I just found xstream.codehaus.org/json-tutorial.html but I am doing basic research now, I may attempt to build a basic server this weekend if I can get an idea of wich libraries to try and implement. Commented Jun 6, 2013 at 17:47
  • Spring does the Job in our Application. If Jackson is found in the classpath, spring automatically uses Jackson to do the serialisation. Commented Jun 6, 2013 at 17:59
  • @Lilith2k3 Does Jackson's output format match what ember-data is looking for via DS.RESTAdapter? Are there any customizations needed for this? Commented Jun 6, 2013 at 22:26
  • Yes and No. With Spring we are dealing with simple POJOs. So the structure of the output via Jackson is dependent on the POJO you created. So if you want [{name:"Doe", firstname:"John"}] you have to handover a List<Person> to Jackson. Hence Spring is MVC, you have a controller ( POJOs with annotations marking a class as Controller and annotations marking methods as endpoints) returning either a view (in our case JSPs) or data to serialize. So a possible method would be Public List<Person> showAllFriends() and Spring uses Jackson to produce the JSON output. Commented Jun 7, 2013 at 6:59

1 Answer 1

2

I would look into any of the following frameworks or libraries to create REST APIs with java and/or scala:

Sign up to request clarification or add additional context in comments.

1 Comment

I would add Grails to that list. It's not Scala or Java, but if Scala is an option, Groovy (the language Grails is implemented in) is quite close. Grails doesn't have a native JSON API marshaller (yet), but neither do most of the other JVM frameworks.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.