4 ms·
I'm currently using Spring MVC (I haven't found a good relatively lightweight Guice-based Web framework yet) I'm experimenting with Guice+Jersey+Angular.JS. It
by nl 14y ago
I'm currently using Spring MVC (I haven't found a good relatively lightweight Guice-based Web framework yet)
I'm experimenting with Guice+Jersey+Angular.JS. It's a nice combination (if you want to do JS applications rather than the traditional MVC thing).
I've tried Sitebrickes[1], but the lack of documentation was a problem.
5. Java means using checked exceptions.
I think most people now accept that Java should have defaulted to using unchecked exceptions, and checked exceptions should only be for very rare cases. It's a mistake, but you are right: things like Spring make it a lot better in that regard.
[1] https://github.com/dhanji/sitebricks https://github.com/dhanji/sitebricks
- murz 14y agoJersey actually has reasonable support for the traditional MVC thing too, you just return a Viewable from your actions [1]. I think out-of-the-box Jersey only supports JSP templates but it's easy to write custom view processors, I hacked one up for Mustache templates a few months ago [2]. [1] http://sleeplessinslc.blogspot.com/2012/02/jersey-jax-rs-mvc-killed-spring-mvc.html http://sleeplessinslc.blogspot.com/2012/02/jersey-jax-rs-mvc... [2] https://github.com/murz/jersey-mustache/blob/master/src/main/java/com/hazardousholdings/jersey/mustache/MustacheViewProcessor.java https://github.com/murz/jersey-mustache/blob/master/src/main...
- cafebabe 14y agoI don't get why people cannot get their head around the differences between a RuntimeException and a generic Exception (which btw. are not the only types that can get thrown). What's so hard? If my contract gives you exceptional cases that you are forced to deal with, I don't want to punish you. I throw those to help you (like an SQLException of my JDBC driver which does not affect any further operations). Of course, those "checked" exceptions must have a purpose within the contract (JDBC-Statements can fail and I tell you why). Otherwise, I use them in a wrong way (like a lot of us do) and should have thrown a RuntimeException instead (the database you're connecting me to is invalid). So a RuntimeException (unchecked exception) is just a case where I cannot serve the contract anymore because of something I failed to deal with and cannot recover from by myself. The mistake is not the differentiation between checked and unchecked exceptions. The real mistake is the lack of documentation (2 lines at RuntimeException's head) that clearly states the purpose of those types, including examples. A lot of programs and APIs would have got this right. People need to think more about the language and the intends of words used in it. There is not much different to normal spoken language.