News for hackers. Stuff that matters.
Re:Build RESTful web services with Java technology by rohshall on Wednesday August 15, 2012 @01:56AM (#4384801)
Thanks a lot for the pointers. I have been looking for a good java framework to learn. I will be more than happy to settle with this 90% you quoted. They look simple enough to understand in a couple of days without wrestling with tons of XML config files.
Re:Build RESTful web services with Java technology by kooshball on Wednesday August 15, 2012 @03:12AM (#4384970)
If you're looking to write a backend service using Java, I would take a serious look at dropwizard http://dropwizard.codahale.com/

The get started page is not that long, and you should be able to kill it in a few hours. At the minimum you get http requests routed to methods and restful json parsed for you automatically. If you want, you can add optional configuration, metrics, healthcheck, logging, db access, views etc.

Re:Build RESTful web services with Java technology by facorreia on Wednesday August 15, 2012 @08:37AM (#4385617)
I've been using dropwizard for a new project and I'm pretty happy with it so far. It's a great head start and a simple architecture.
Re:Build RESTful web services with Java technology by mbell on Wednesday August 15, 2012 @02:12AM (#4384831)
I should add that my "90% of the way there" gets you a service that easily speaks JSON via REST calls. Its all you need if your frontend is backbone based or its just a service getting called by another layer. If you need to actually render web pages in response you'll need something for views/templating, freemarker is a reasonable option and JSF isn't terrible if you avoid half of it (looking at you ViewScoped). But, honestly, I would do the page rendering elsewhere, I don't think there is a good Java answer for this, maybe the Play Framework, haven't used it much yet.

In my case the Java backend exposes RESTful models via JSON which are consumed by a rails app using Her[0] a great gem that is what ActiveResource should have been. It wires up to Jersey quite easily.

[0] https://github.com/remiprev/her

Re:Build RESTful web services with Java technology by rohshall on Wednesday August 15, 2012 @02:45AM (#4384910)
Someone on StackOverflow was suggesting to use RESTEasy with HTMLEasy to generate HTML automatically from REST services.
Re:Build RESTful web services with Java technology by rauar on Wednesday August 15, 2012 @02:51AM (#4384930)
Well. I know what you mean (XML hell). However to some degree doing config stuff in files and not in the code really makes sense...

However Spring using JSON as configuration format would be awesome :)

Re:Build RESTful web services with Java technology by moondowner on Wednesday August 15, 2012 @02:55AM (#4384937)
You don't need JSON configuration even if it was existing.

You can use annotation based configuration (meaning Java classes with annotations like @Configuration, @EnableWebMvc etc..) for > 90% of the configuration cases:

http://blog.springsource.org/2011/06/10/spring-3-1-m2-config...

Re:Build RESTful web services with Java technology by rauar on Wednesday August 15, 2012 @03:11AM (#4384968)
I prefer plain files instead of annotations. Just wish the non-readability of XML would go away with less bloated format (which other frameworks did with JSON).
Re:Build RESTful web services with Java technology by moondowner on Wednesday August 15, 2012 @04:41AM (#4385142)
Fair enough argument :)

Though, now that I've gotten into the annotation way I like it the most.

Re:Build RESTful web services with Java technology by rauar on Wednesday August 15, 2012 @02:07PM (#4387273)
I mix them usually. Layer-oriented stuff like @Transactional and @RequestMapping incl. Path/HTTP Method etc. in the code, central declaration stuff like e.g. Marshallers, HandlerAdapters, global ExceptionHandlers in XML...

:)