开发者

`rails console` in Java EE application

I came to Java from the world of Rails. Ruby on Rails has one cool feature, called rails console. It loads the entire environment a开发者_StackOverflownd lets you play with a dynamic interpreter (irb), so you can execute any code in the context of your application and intermediately get result.

Is it possible to do similar with Java EE? i.e. connect to your application server and execute dynamic code in its context? For example, in the Groovy programming language.

I use Java EE 5 with GlassFish 2.1


A Java web application has nothing like rails console. However, a Grails web application has a console that provides identical functionality, you start the console by executing grails console from the root dir of the application.

A Grails application is written in Groovy (though in most cases you can use Java instead of Groovy). The Groovy language provides a Groovy console that you can use to test snippets of Groovy or Java code, there's also an online version.


No, Java's not like Ruby or Python. If you want new code on Glassfish, you'll have to compile, package, and deploy it to the app server.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜