反向 AJAX (Comet) 和 Spring MVC 与 Scala/LIFT 对比?
有一个 IBM 的演示,展示了反向操作是多么简单AJAX 可以与 DWR 2 一起使用。另一方面,Scala/LIFT 具有内置的反向 AJAX 功能。
问题:如果这与 Spring MVC 配合良好,有什么经验吗?
问题:如果您从头开始,相比 DWR/Spring MVC,Scala/LIFT 的优点和缺点是什么
问题:在 Scala/LIFT 中,安全处理是否与 Spring Security 中一样复杂?
There is a demo by IBM that shows how easy Reverse AJAX can be used with DWR 2. On the other hand, Scala/LIFT comes with built-in Reverse AJAX capability.
Question: Any experience if this works fine with Spring MVC?
Question: If you'd start from scratch, what are the pros and cons for preferring Scala/LIFT over DWR/Spring MVC
Question: In Scala/LIFT, is the security handling as sophisticated as in Spring Security?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(3)
这两个安全系统仅涵盖基本场景,并且需要大量定制才能在实际项目中使用。
这就是我在 Scala 中构建 COMETed RIA 时所用的:
The both security systems cover just basic scenarios, and require a lot of customization to be used in real-world projects.
That's what I would use for building COMETed RIA in Scala:
另一种替代方案,以纯 Java(或任何其他 JVM 语言,包括 Scala)为中心,是 ItsNat Comet。
Another alternative, pure Java (or with any other JVM language including Scala) centric is ItsNat Comet.
Novell 在评估了多种不同的技术后,选择 Lift 的 Comet 架构为其 Pulse 产品提供支持。
Lift 的 Comet 实现使用单个 HTTP 连接来轮询页面上任意数量的组件的更改。每个组件都有一个版本号。长轮询包括版本号和组件 GUID。在服务器端,侦听器附加到长轮询请求中列出的所有 GUID。如果任何组件具有更高的版本号(或者在长轮询期间版本号增加),则增量(描述每个版本的更改的一组 JavaScript)将被发送到客户端。应用增量并将客户端上的版本号设置为更改集的最高版本号。
Lift 将长轮询与会话管理集成在一起,这样,如果在长轮询期间请求进入同一 URL 会导致连接匮乏,则长轮询将终止以避免连接匮乏(某些浏览器每个命名服务器最多有 2 个 HTTP 连接,其他最多为 6)。 Lift 还支持用于长轮询请求的 DNS 通配符服务器,这样浏览器中的每个选项卡都可以针对不同的 DNS 通配符服务器进行长轮询。这避免了连接匮乏的问题。
Lift 动态检测 Servlet 在 Jetty 6 和 Jetty 上运行的容器。 7 和(很快)Glassfish,Lift 将使用平台的“延续”实现来避免在长轮询期间使用线程。
Lift 的 JavaScript 可以位于 jQuery 和 YUI 之上(也可以位于 Prototype/Scriptaculous 之上。)实际的轮询代码包括连接失败时的回退以及处理瞬时连接失败的其他“优雅”方式。
我研究过 Atmosphere、CometD、Akka(所有面向 JVM 的 Comet 技术)。没有一个(在我评估它们时)支持每页多个组件或避免连接匮乏。
Novell 从头开始,出于一些非常充分的理由选择 Lift 来支持 Pulse。
在安全性方面,Lift 轻而易举地击败了 Spring + Spring Security。请参阅 http://www.mail-archive.com/[email protected]/msg13020.html
基本上,Lift 的安全性已融入您的应用程序中。默认情况下,Lift 应用程序可以抵抗常见问题(跨站点脚本、重放攻击、跨站点请求伪造)。默认情况下,Lift 应用程序可以防止参数篡改。 Lift 的站点地图定义了站点导航和访问控制规则。这意味着您永远不会有别人无法点击的链接。您不需要拥有必须独立于应用程序进行配置的外部过滤器(例如 Spring Security)(哎呀...移动了页面,但忘记确保 Spring Security XML 文件已更新。)
哦。 ..如果您不想使用模板语言,这里有一个完整的 Lift Comet 聊天组件:
并将其插入页面:
Lift's Comet Architecture which was selected by Novell to power their Pulse product after they evaluated a number of different technologies.
Lift's Comet implementation uses a single HTTP connection to poll for changes to an arbitrary number of components on the page. Each component has a version number. The long poll includes the version number and the component GUID. On the server side, a listener is attached to all of the GUIDs listed in the long poll requests. If any of the components has a higher version number (or the version number increases during the period of the long poll), the deltas (a set of JavaScript describing the change from each version) is sent to the client. The deltas are applied and the version number on the client is set to the highest version number for the change set.
Lift integrates long polling with session management so that if a request comes into the same URL during a long poll that would cause connection starvation, the long poll is terminated to avoid connection starvation (some browsers have a maximum of 2 HTTP connections per named server, others have a max of 6). Lift also supports DNS wild-carded servers for long poll requests such that each tab in the browser can do long polling against a different DNS wildcarded server. This avoids the connection starvation issues.
Lift dynamically detects the container the Servlet is running in and on Jetty 6 & 7 and (soon) Glassfish, Lift will use the platform's "continuations" implementation to avoid using a thread during the long poll.
Lift's JavaScript can sit on top of jQuery and YUI (and could sit on top of Prototype/Scriptaculous as well.) The actual polling code includes back-off on connection failures and other "graceful" ways of dealing with transient connection failures.
I've looked at Atmosphere, CometD, Akka (all JVM-oriented Comet technologies). None had (at the time I evaluated them) support for multiple components per page or connection starvation avoidance.
Novell started from scratch and chose Lift to power Pulse for some very good reasons.
In terms of security, Lift beats Spring + Spring Security hands down. See http://www.mail-archive.com/[email protected]/msg13020.html
Basically, Lift's security is baked into your application. Lift apps are resistant to common problems (cross site scripting, replay attacks, cross site request forgeries) by default. Lift apps are resistant to parameter tampering by default. Lift's sitemap defines site navigation and access control rules. This means you never have a link that someone can't click on. You don't need to have an external filter (e.g., Spring Security) that you have to configure independently from you app (whoops... moved a page, but forgot to make sure the Spring Security XML file was updated.)
Oh... and if you don't want to use a templating language, here's a complete Lift Comet chat component:
And to insert this into a page:
<lift:comet type="Chat"/>