简体   繁体   English

带有Coffeescript的Java Simple框架

[英]Java Simple framework with Coffeescript

Has anybody got experience in integrating Java Simple Framework with Coffeescript? 有没有人有将Java Simple Framework与Coffeescript集成的经验? I'm desperately in need of an example to compile Coffeescript in run-time. 我迫切需要一个例子来在运行时编译Coffeescript。 I'm thinking of wro4j but not sure how to integrate that with Java Simple Framework. 我在考虑使用wro4j,但不确定如何将其与Java Simple Framework集成。

You could use the rhino javascript engine, here's a nice short tutorial: 你可以使用rhino javascript引擎,这是一个很好的简短教程:

http://metoojava.wordpress.com/2010/06/20/execute-javascript-from-java/ http://metoojava.wordpress.com/2010/06/20/execute-javascript-from-java/

And include this file (the coffeescript to javascript compiler, written in javascript): 并包含此文件(coffeescript到javascript编译器,用javascript编写):

http://coffeescript.org/extras/coffee-script.js http://coffeescript.org/extras/coffee-script.js

Then use CoffeeScript.compile() to compile and then run your code. 然后使用CoffeeScript.compile()编译然后运行代码。 Would that work for your needs? 这会满足您的需求吗?

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM