Spring MVC& UI组件 [英] Spring MVC & UI Components

查看:115
本文介绍了Spring MVC& UI组件的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正处于一个小型的单页面Web应用程序的技术选择阶段,该应用程序将基于AJAX,并将报告给Java后端。

I'm in the "technologies selection" phase of a small, single-page web application that will be heavily-based in AJAX, and which will report to a Java backend.

在我几周前发布的上一个问题中,SO社区强烈认为,使用基于Spring MVC的Web应用程序比使用JSF更好。由于Spring是面向请求的,而JSF是面向组件的,所以只使用Spring来实现异常请求很多的东西。

In a previous question I posted several weeks ago, the SO community at large felt strongly that I would be better off going with a Spring MVC-based web app than with something in JSF. Since Spring is request-oriented, and JSF is component-oriented, it would only make sense to use Spring for something that is going to be getting a lot of asynchronous requests.

如果我 进入JSF路线,那么我的下一组决定是否是为视图技术使用所谓的UI组件库,例如< a href =http://primefaces.org/ =noreferrer> PrimeFaces , IceFaces MyFaces

If I were going the JSF route, then my next set of decisions would be whether or not to use so-called UI component libraries for the view technology, such as PrimeFaces, IceFaces or MyFaces.

所以,我想知道: Spring MVC有没有类似于PrimeFaces(或其喜欢的)为我的页面创建视图组件的东西?我知道它不是基于组件的,但我并不熟悉Spring MVC的Web平台,并且想知道什么是一些事实上的标准(如果有的话)或Spring Web开发人员使用的典型技术堆栈用于构建漂亮的网页。

So, I'm wondering: Does Spring MVC have anything similar to, say, PrimeFaces (or its likes) for creating the view component for my page(s)? I know its not component-based, but I'm not all that familiar with Spring MVC's web platform and was wondering what are some de facto standards (if any) or typical technology stacks that Spring web developers use for constructing nice web pages.

而且,如果Spring只使用run-o-the-mill模板引擎,那就像 Freemarker 就够了吗?

And, if Spring just uses run-o-the-mill template engines, would something like Freemarker suffice?

我想这是一个最佳实践类型的问题一位崭露头角的Spring网站开发人员。

I guess this is a "best practices"-type question for a budding Spring web developer.

提前致谢!

推荐答案

通常,所谓的UI组件的价值在于它们如何通过与有状态框架集成来跟踪服务器端的用户交互。

Typically, the value so-called UI components lies in how they keep track of user interactions on the server side by integrating with a stateful framework.

因为你决定去对于面向请求的框架,使用一些着名的客户端JavaScript库会更有意义。热门选择包括:

Since you have decided to go for a request oriented framework, it would make more sense to use some well-known client-side JavaScript libraries instead. Popular choices include:

  • Backbone.js – an MVC foundation for user interfaces
  • jQuery UI for some premade widgets (calendars, etc.)
  • If you want to go down a more complex route, but with a more desktop-like feel, Sproutcore
  • Finally, if you wish to avoid JavaScript, you can useGoogle Web Toolkit, which compiles Java to JavaScript and is supposed to have good integration with Spring.

就个人而言,如果我不需要很多标准的预构建小部件,我喜欢Backbone.js + underscore.js + jQuery。我不喜欢Google Web Toolkit,因为它感觉就像编写一个pidgin JavaScript,在那时我更喜欢直接编写JavaScript。

Personally, if I don't need a lot of standard prebuilt widgets, I like Backbone.js + underscore.js + jQuery. I don't like Google Web Toolkit since it feels like writing a pidgin JavaScript, and at that point I prefer to write JavaScript directly.

这篇关于Spring MVC&amp; UI组件的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆