Reputation: 163
I'm new to the web world and trying to use my Java knowledge to build a web app, want to keep it simple and lightweight as possible, so after some research I heard lot about Sinatrarb and have been trying to mimic something like it in Java, also, want to do everything server side, no client side stuff yet.
So I have come to the conclusion(probably wrong about this) to learn the following:
My goal is to create a web application (as opposed to an API), so I need to render HTML (of course, if can I render JSON and HTML at the same time that would be awesome).
Since I'm a bit all confused by this my questions are:
Any recommendations on this are greatly appreciated.
Thanks!
Upvotes: 2
Views: 2531
Reputation: 3928
I would strongly encourage you to take a look at the dropwizard framework. It is built on top of a nice battery of tools to build a web application using Java; and most of the tools that the frameworks decides to use (Jetty, Jersey etc.,) are exceptionally good at what they do.
This also allows you to work at a higher abstraction (unless of course you want to work at a lower level in which case dropwizard might not be right choice) and not having to worry about deployment and management of the web application as the final executable you build can be run from the command line.
Upvotes: 1
Reputation: 105093
I would recommend you to take a look at ReXSL framework, which integrates Jersey (JAX-RS), JAXB and XSL in order to build fully-functional web sites and web APIs in one package. So, you don't need to make a choice any more - whether to create a web application or an API - you create them both at the same time.
Upvotes: 0
Reputation: 1079
Jersey is really just for writing or consuming REST API's. If you're just doing a web interface, you probably need to have a good idea how Servlets work, but then move very quickly to a templating language like JSP, which is closely tied to the Servlet model, or maybe something like Freemarker or Velocity.
Jersey is useful, but it's not going to really help you much with writing HTML.
Upvotes: 1