请任何人分享他在该主题上的经验吗?

在tomcat上使用jpda时,即使通过spring加载的类也可以重载类吗?可以说,我在Spring上下文中加载并实例化了几个类,我想在其中一个中更改一个方法。

通常,将替换,重新加载该类,并从该类的新版本中实例化所有其他实例。我想即使是旧实例也要替换成旧实例?

使用Spring时,这也可行吗?这样我就有了一个mvc控制器并更改了它的方法?

或者我必须使用JRebel来满足此要求。

有帮助吗?

解决方案

My experience with this is that it works well and reliably, provided you don't of course change the method signature, add fields etc. Changing the implementation of any existing method of any class in the spring container (MVC controllers included) should work entirely as expected. For reference, the last time I tested this was with Tomcat 6, Spring 3 and using Netbeans 6.9's "Apply Code Changes" over a remote attached debugger, but it's Java standard so I doubt the IDE will effect it much.

EDIT: None of the above concerns JRebel (I've never used it).

许可以下: CC-BY-SA归因
不隶属于 StackOverflow
scroll top