You can try JRebel to save your time.
If you are using Eclipse, here has good step-by-step installation and configuration guide: http://manuals.zeroturnaround.com/jrebel/ide/eclipse.html
For more information, please check http://zeroturnaround.com/software/jrebel/learn/
Demo
Here has code snippet, and it will print debug message as entering this method
1 2 3 4 5 6 7 8 9 10 11 12 | @RequestMapping(value = "/query/tab1", method = RequestMethod.POST, consumes = MediaType.APPLICATION_JSON_VALUE, produces = MediaType.APPLICATION_JSON_VALUE) public @ResponseBody List findTab1(@RequestBody Fms420rFormBean formBean, Alerter alerter) { log.debug("test"); List dataList = service.queryTab1(formBean.getYear(), formBean.getMonth()); if (CollectionUtils.isEmpty(dataList)) { alerter.info(Messages.warning_notFound()); } else { alerter.info(Messages.success_find()); } return dataList; } |
In order to test JRebel, I just modified the debug message to "JRebel test" and submit query without restart application server
1
2
3
4
5
6
7
8
9
10
11
12
@RequestMapping(value = "/query/tab1", method = RequestMethod.POST, consumes = MediaType.APPLICATION_JSON_VALUE, produces = MediaType.APPLICATION_JSON_VALUE)
public @ResponseBody
List findTab1(@RequestBody Fms420rFormBean formBean, Alerter alerter) {
log.debug("JRebel test");
List dataList = service.queryTab1(formBean.getYear(), formBean.getMonth());
if (CollectionUtils.isEmpty(dataList)) {
alerter.info(Messages.warning_notFound());
} else {
alerter.info(Messages.success_find());
}
return dataList;
}
See....I don't redeploy and restart application server, but the console print the up-to-date debug message. It's because of JRebel reload any changes classes automatically.
When you change any class or resource in your IDE, the change will reflect in you application immediately, skipping the build and redeploy phases.
No comments:
Post a Comment