简体   繁体   English

哪些Java Web框架提供热重载?

[英]Which Java web frameworks provide hot-reload?

I'd like to know which Java web application frameworks provides a "hot reload" capability, ie, it allows to develop applications and has them redeployed on the server "almost instantly" (ie, in less than a few seconds). 我想知道哪些Java Web应用程序框架提供了“热重新加载”功能,即它允许开发应用程序并将它们“几乎立即”(即在不到几秒钟内)重新部署在服务器上。

In the Java world, Play! 在Java世界中, 玩! does that out of the box, but what I'm looking for is a more exhaustive list. 开箱即用,但我正在寻找的是一个更详尽的清单。

Other examples that I'm aware of include: Nuxeo WebEngine, provided you're using Eclipse and the right plugin, or, in the Python world, Django and Pylons (when using the --reload option). 我所知道的其他例子包括:Nuxeo WebEngine,前提是你正在使用Eclipse和正确的插件,或者在Python世界中,使用Django和Pylons(当使用--reload选项时)。

As far as I know, you can do hot reload with almost every java framework if using jrebel . 据我所知,如果使用jrebel ,几乎每个java框架都可以进行热重载。 Some frameworks have some kind of hot-deploy built in, as noted in other answers. 如其他答案所述,某些框架内置了某种热部署。

If someone might be interested after those months: 如果有人在这几个月后感兴趣:

you can configure jetty so that it will hot deploy your compiled classes (eclipse + netbeans have the compile on save feature). 你可以配置jetty,以便它将热部署你编译的类(eclipse + netbeans具有编译保存功能)。 With maven you can type mvn jetty:run after this config in your pom.xml: 使用maven,您可以键入mvn jetty:run在pom.xml中mvn jetty:run此配置后:

        <plugin>
            <groupId>org.mortbay.jetty</groupId>
            <artifactId>maven-jetty-plugin</artifactId>
            <version>${jetty.version}</version>
            <configuration>
                <scanTargets>
                    <scanTarget>target/classes/</scanTarget>
                </scanTargets>
                <scanIntervalSeconds>1</scanIntervalSeconds>
            </configuration>
        </plugin>

This can be done without the use of jrebel and it means: do a change in the IDE + save it + go to your browser + F5 => you are done! 这可以在不使用jrebel的情况下完成,这意味着:在IDE中进行更改+保存+转到浏览器+ F5 =>完成了!

With that feature eg wicket or vaadin are hot deployable (but others too!) 有了这个功能,例如wicket或vaadin是可热部署的(但其他人也是!)

Tapestry 5具有单一类/页面更改的热部署,Seam也是如此。

I'm going to assume you want this for development purposes and not for production (as hot-reloading in production for Java == big time fail). 我将假设您希望将其用于开发目的而不是用于生产(因为Java生产中的热重新加载= =大时间失败)。 Very rarely will I shill a commercial product, but if you want hot-reloading in Java to speed up development, what you really want is JRebel . 我很少会购买商业产品,但如果你想用Java加热重新加速开发,你真正想要的就是JRebel It's hot reloading will be fairly effortless on your part. 热门重装对您来说相当轻松。

NOTE : Whatever you do, do not use JRebel (or any hot deployment, for that matter) for your Java apps. 注意 :无论您做什么,都不要为Java应用程序使用JRebel(或任何热部署)。

在块上有一个新的孩子,RelProxy,它是开源的,不像JRebel那样先进,但它可以用来在运行时自由更改代码的子集并重新加载它几乎没有性能损失而且不需要上下文重新加载如果你愿意,在开发和生产中没有会话丢失。

如果您使用POJOs而不是EJBsSeam framework应该在您的列表中。

If you want to edit your Java (controller, model) code and refresh your browser to see changes immediately and without restarting your web server, you can use scooter . 如果要编辑Java(控制器,型号)代码并刷新浏览器以立即查看更改而无需重新启动Web服务器,则可以使用scooter By the way, its built-in tool File Browser allows you to edit(compile) your code thru a browser. 顺便说一句,它的内置工具文件浏览器允许您通过浏览器编辑(编译)您的代码。 A browser may not be capable as an IDE, but it helps you remotely develop your app. 浏览器可能无法作为IDE使用,但它可以帮助您远程开发应用程序。

When developing a struts(2) application in eclipse it's also automatically reloaded as soon as you save a file which compiles successfully. 在eclipse中开发struts(2)应用程序时,只要保存成功编译的文件,它也会自动重新加载。

However, sessions are lost on every reload which is a bit annoying.. 但是,每次重新加载都会丢失会话,这有点烦人。

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

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