单页Web应用程序的Java框架或例子? [英] Single page Web App in Java framework or examples?

查看:296
本文介绍了单页Web应用程序的Java框架或例子?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

有没有人见过一个例子或做Java中的以下内容:
<一href=\"http://duganchen.ca/single-page-web-app-architecture-done-right/\">http://duganchen.ca/single-page-web-app-architecture-done-right/

Has anyone seen an example or done the following in Java: http://duganchen.ca/single-page-web-app-architecture-done-right/

这是一个设计一个页面的Web应用程序,将与谷歌的搜索引擎优化工作,干出大规模侵犯使用Java技术?

That is a design a single page web app that will work with Google SEO with out massive violation of DRY using Java technologies?

这似乎并不可怕很难做到这一点对我自己,但我很好奇(懒),看看是否有人已经与Spring或JAX-RS做到了。

It doesn't seem terrible hard to do this on my own but I was curious (and lazy) to see if someone had already done it with either Spring or JAX-RS.

推荐答案

我已经建立了一个相当大的单页 JavaScript的网站 ,这generats在客户端上的所有HTML。服务器提供JSON只响应。我用谷歌关闭工具的原因如下:

I have built quite a large "single-page" javascript website, that generats all HTML on the client. Server provides JSON only responses. I used Google Closure tools for the following reasons:


  • 谷歌Closure模板可让在其中编译要么纯JavaScript功能,在客户端或Java code上运行高位运行水平模板语言(命名为大豆)设计模板服务器站点。

  • Google Closure Templates allows designing templates in high level templating language (named soy) which is compiled either to pure javascript functions to run on the client or java code to run on the server site.

谷歌关闭编译器,允许分离的JavaScript code模块和提供autmatic依赖注入未编译模式。良好的程序结构和模块化是必要的任何项目超过简单的HTML装饰。这是很难实现与像jQuery或道场框架。在高级模式下编译它把你的JavaScript较短的一个更有效的等价物,消除死code和做规模急剧降低,可以收缩原来的codeBase的为原始大小的百分之几。

Google Closure Compiler, which allows separating javascript code to modules and provides autmatic dependency injection for uncompiled mode. Good program structure and modularisation is necessary for any project exceeding simple html decoration. This is hard to achieve with frameworks like jQuery or dojo. In advanced compiled mode it transforms your javascript to shorter an more efficient equivalent, eliminates dead code and do dramatic reduction in size, which can shrink the original codebase to few % of the original size.

谷歌样式表是与封闭的编译器的伟大工程的元语言的CSS

Google Stylesheets is meta css language which works great with closure compiler.

谷歌关闭图书馆是巨大的,行之有效的JavaScript库,并与封闭的编译器,你只需要所需要的。

Google Closure Library is huge and well tested javascript library and with closure compiler, you only take what is needed.

要简化开发,我使用 plovr ,写的Michale博林,一前GOOGLE,原来封闭的成员之一编译器团队。

To streamline the development, I'm using plovr, written by Michale Bolin, a former googler, one of the members of the original Closure Compiler Team.

我可以推荐阅读Michale的书:闭幕,权威指南

I can recommend reading Michale's book: Closure, the Definitive Guide.

我必须警告,但是,最初的leraning曲线可能会觉得很陡峭的,但它是非常值得的痛苦。谷歌用这个工具来编写几乎所有的Web项目。

I must but warn, the initial leraning curve might be quite steep, but it is well worth the pain. Google used this tools to write almost all their web projects.

如果你感觉真的冒险,并希望在窥视未来,我建议升级使用Clojure / ClojureScript前者的策略。对于一开始,观看此的href=\"http://blip.tv/clojure/rich-hickey-unveils-clojurescript-5399498\">很有说服力的谈话,自己一定要检查的 Clojurescript一个项目

If you feel really adventurous, and want to peep in to the future, I recomend upgrading the former strategy with Clojure/ClojureScript. For the start, watch this very persuasive talk of Rich Hickey and make sure to check Clojurescript one project.

这篇关于单页Web应用程序的Java框架或例子?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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