6 ms·
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 s
by rohshall 14y ago
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.
- mbell 14y agoI 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 https://github.com/remiprev/her
- rohshall 14y agoSomeone on StackOverflow was suggesting to use RESTEasy with HTMLEasy to generate HTML automatically from REST services.
- rauar 14y agoWell. 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 :)
- moondowner 14y agoYou 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-configuration-enhancements/ http://blog.springsource.org/2011/06/10/spring-3-1-m2-config...
- rauar 14y agoI 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).
- moondowner 14y agoFair enough argument :) Though, now that I've gotten into the annotation way I like it the most.
- rauar 14y agoI 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... :)
- kooshball 14y agoIf you're looking to write a backend service using Java, I would take a serious look at dropwizard http://dropwizard.codahale.com/ 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.
- facorreia 14y agoI'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.