Pergunta

Alguém poderia compartilhar sua experiência sobre este tópico?

Ao usar jpda no tomcat, o recarregamento de classe funciona mesmo para classes carregadas via spring?Digamos que eu tenha o contexto do spring com algumas classes carregadas e instanciadas e quero alterar um método em uma delas.

Em geral, a classe é substituída, recarregada e todas as outras instâncias são instanciadas a partir da nova versão da classe.Suponho que mesmo as instâncias antigas sejam substituídas pelas antigas?

Isso também funciona quando o Spring é usado?Para que eu tenha um controlador mvc e mude seu método?

Ou eu tenho que usar JRebel para este requisito.

Foi útil?

Solução

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).

Licenciado em: CC-BY-SA com atribuição
Não afiliado a StackOverflow
scroll top