7

我正在使用 Spring 框架开发 RESTful 后端。所有服务都可以通过 HTTP 请求方法 ( GET, POST, PUT, DELETE) 访问。

你能告诉我前端框架的最佳组合是什么吗?

最好使用 SpringMVC 或 Backbone 之类的其他框架是否足够好?

如果我将 SpringMVC 用于 REST 后端,并将 SpringMVC 用于前端,那么首先为后端然后再为前端做同样的事情会不会是额外的工作?

最重要的是,我对如何使用前端进行会话管理感到困惑?

任何帮助将不胜感激!

4

4 回答 4

2

Templates

Since you said "server-side" GUI, maybe you are thinking more along the lines of a template engine for creating HTML? This isn't really restful, but can be MVC like if you are forwarding from your Controller classes.

But PLEASE keep in mind that it would be a very BAD idea to try and generate XML or JSON data for consumption by RESTful clients (ajax) with either of these. Just say no to JSON creation from a template engine!

JSP is pretty much the standard for Java EE at the moment, or is most widely used. All you need is a compliant server, such as Tomcat/Jetty.

http://www.oracle.com/technetwork/java/javaee/jsp/index.html

Thymeleaf It looks a lot cleaner than JSP, and has the added benefit of not allowing all the pitfalls that can happen with a JSP (and there are a lot).

http://www.thymeleaf.org/

JavaScript:

When you say you are creating a RESTful backend, most people would make the conclusion (and rightfully so) that you are trying to develop a JavaScript MVVM client/GUI.

Kendo UI has a complete set of GUI widgets and MVVM framework that is specifically designed to work with a RESTful backend. But it's a paid for API.

http://www.telerik.com/kendo-ui

YUI3 (Yahoo User Interface) has a variety of widgets as well, and I've seen a lot of jobs requesting this. It has the advantage of being free/OSS as well. Older version are deprecated.

https://github.com/yui/yui3/wiki

knockout.js has been my favorite for MVVM engines that I've actually had experience working with. And it's simple to learn, in my opinion.

http://knockoutjs.com/

Angular.js Also free/oss, and works well with other GUI APIs.

https://angularjs.org/
于 2015-01-22T23:13:26.323 回答
2

如果您正在考虑制作 SPA(单页应用程序),请确保查看 AmpersandJS -> http://ampersandjs.com/

于 2014-08-01T05:02:37.160 回答
1

我建议您将Sencha Ext JS用于前端,它是最好的框架之一,并且可以与RestFul back-end.

于 2013-02-13T06:16:22.770 回答
1

这是一个很好的问题,但我认为没有专门为使用 REST 服务器后端而构建的服务器端框架。我认为您可以使用 Spring-MVC / Spring-Boot 来获得良好的开端,但您可能还想研究 Rails 或其他 Ruby 任何其他现代 Web 框架技术。

于 2015-01-22T20:38:38.793 回答