Lightweight Java web stack using Guice-servlet / Jetty / Jersey - some questions

I'm thinking of developing a new web application using lightweight components rather than the full stack structure.

This article is my main inspiration!

Jetty : web server. I will probably use the built-in version for development, but with the ability to export the application as .war and use an external Jetty server for the production environment.

Guice / Guice-Servlet : for dependency injection and for matching servlets and filters.

Jersey . To serialize routing / request / response json (de) if necessary.

Important note: I know that some people will use this jersey stack only as a web services layer and will use the Javascript structure (Backbone, AngularJS, etc.) to use these services and execute most of the presentation logic in Javascript . I am not ready for such client materials yet. I still prefer to use JSP and send plain HTML to clients that have javascript disabled.

So my questions are:

  • What is the best way to manage forms using jersey? With the help of Spring MVC (which I used in other projects) there is this concept of “helper objects”, where the transmitted POST data is automatically bound to the substrate object, which is then easily reproduced. Is there something similar with jersey?

  • , , , @Path, , , . , JAX-RS @Path , ? , ?

  • (, , Play Framework). , , , , ?

  • , , ? , ?

  • / - Java?

:

UrlRewriteFilter .

ActiveWeb, " ", , , , : .

+5
1

. Guice Spring , . , Guice SpringMVC - , , .

Guice Spring, :

! . , . Spring - , , . - Spider Oct 7 '11 16:25

Guice DI. . , tempaltes . Sitebricks. SitebrickModule :

public class MyAppConfig extends SitebricksModule {
@Override
protected void configureSitebricks() {
    at("/movies").show(MoviesPage.class); // basic page
    at("/actors").serve(ActorsPage.class); // service
    embed(SoundtrackPage.class).as("Soundtrack"); // brick
}

}

Sitebricks tempalting: MVEL, Freemarker,...

, REST javascript:

Reply<Product> view() {
  return Reply.with(new Product("Anti-ageing cure"))
              .as(Json.class);
}

.

0

All Articles