5

It is almost year 2013, HTML5 age. jQuery is the de-facto standard for web Javascript-ing.

This link was good for year 2010: https://stackoverflow.com/questions/3882082/rest-json-web-services-java-ee-framework

I am looking for Java web framework that will expose domain classes via RESTful JSON web services. Then will [hopefully] generate web forms for those domain classes. And uses jQuery ajax to communicate with server for sending/receiving JSON data and populate in HTML.

All web UI processing should be in client browser. Server should just transmit static HTML5 pages. No server-side processing like JSP.

UPDATE. I must clarify that my question point is not what framework to use for web-services creation. (There are a lot like Apache CXF, Spring MVC web services). It is not also about jQuery or not. But Java framework that will save time for boilerplate coding of client-server communication.

Groovy & Scala are great things, but they are not Java, but JVM languages. (Imagine telling your teammates "We should learn Java-like language with some differences to start using a new framework." )

Bottom line:

Java web framework + static HTML5 pages + JSON interaction

Community
  • 1
  • 1
Paul Verest
  • 60,022
  • 51
  • 208
  • 332
  • You're looking for [Play Framework](http://stackoverflow.com/questions/1597086/any-experience-with-play-java-web-development-framework). My answer was tongue-in-cheek. Look at the [AMD pattern](http://requirejs.org/docs/whyamd.html) (with RequireJS, Backbone.js). Web apps can and should focus as much on the way the client is controlling things. My experience has been a lot of server-siders (nothing wrong with that) don't quite get how *modern* a browser and *Javascript* is these days. [Knockout.js](http://knockoutjs.org), [ExtJS](http://dev.sencha.com/deploy/ext-4.0.0/examples/). Nice. – Jared Farrish Dec 14 '12 at 09:30
  • Oh yeah, and [GWT](https://developers.google.com/web-toolkit/) With GWT, you could use [ExtJS GXT](http://www.sencha.com/products/gxt/examples/). That desktop app is pretty slick. And you also got [RestyGWT](http://restygwt.fusesource.org/documentation/restygwt-user-guide.html). – Jared Farrish Dec 14 '12 at 09:54
  • One more possibility is [TIBCO General Interface (GI)](http://www.generalinterface.org/). This system is very interesting, if you're building a complex client-side data-driven domain-controlled distributed app. Not sure if I got enough ten dollar words there, but don't be fooled, lots of sophistication here; more than I've had the need to use. I think it was developed mostly for enterprise stock/finance/commodities trading platforms. See: "MVC in the client", IDE, integration testing, etc., with DWR/Hibernate on the server. See: http://www.generalinterface.org/docs/display/DOC/Learning+Center – Jared Farrish Dec 15 '12 at 01:22

3 Answers3

2

Did you trying exploring Spring for domain-rest mapping and Grails's Scaffolding ? Try exploring these links to achieve your goal :

  1. Domain mapping to REST endpoint
  2. More on domain rest antipattern
  3. Generate whole application using domain model using scaffolding
Saurabh
  • 7,894
  • 2
  • 23
  • 31
2

Your right it is almost 2013 why not just expose your Rest Web Services with nodeJS!

If your adamant about Java then look at Spring MVC as an alternative to Jax-RS. With Spring (and Jackson for JSON marshall/unmarshall) you can do something like:

@Controller
@RequestMapping("/resource")
public class ResourceController
{
    @Autowired
    private ResourceService resourceService;

    @RequestMapping(value="/{id}", method=RequestMethod.GET)
    public @ResponseBody Resource getResource(@PathVariable Integer id)
    {
        return resourceService.lookup(id);
    }
    ...
}

public class Resource
{
    @JsonProperty("id")
    private int id;
    @JsonProperty("resourceName")
    private String name;
    ...
}

Hope that helps.

ramsinb
  • 1,985
  • 12
  • 17
0

I have not found any Java web framework, that would take care of authoring static HTML5 and JavaScript.

For server-side there are Apache CXF, Spring MVC, and a lot other frameworks, that support RESTful web services.

Paul Verest
  • 60,022
  • 51
  • 208
  • 332