Fabrice-TIERCELIN on master
Move common code (compare)
Fabrice-TIERCELIN on master
Bypass the class keyword using … (compare)
Fabrice-TIERCELIN on master
Format or conditions (compare)
Fabrice-TIERCELIN on master
Format and conditions (compare)
Fabrice-TIERCELIN on master
Finish to rewrite newMethodInvo… (compare)
Fabrice-TIERCELIN on master
Almost finish to rewrite newMet… (compare)
Fabrice-TIERCELIN on master
Improve method invocation naming (compare)
Fabrice-TIERCELIN on master
Continue to rewrite newMethodIn… (compare)
Fabrice-TIERCELIN on master
Continue to rewrite newMethodIn… (compare)
Fabrice-TIERCELIN on master
Continue to rewrite newMethodIn… (compare)
Fabrice-TIERCELIN on master
Continue to rewrite newMethodIn… (compare)
Fabrice-TIERCELIN on master
Still continue to rewrite newMe… (compare)
Fabrice-TIERCELIN on master
Separate analyze and refactoring (compare)
Fabrice-TIERCELIN on master
Continue to rewrite newMethodIn… (compare)
Fabrice-TIERCELIN on master
Start to rewrite newMethodInvoc… (compare)
Fabrice-TIERCELIN on master
Sort the tests (compare)
Fabrice-TIERCELIN on master
Separate passing cases and fail… (compare)
Fabrice-TIERCELIN on master
Split cleanup: Replace calls to… (compare)
mvn clean install
fails
I have a legacy springMvc project and i want to refactor all the controllers to return ResponseEntity<T> object rather then returning Model object which is returned by default.
I am looking for a way to map functions in Map class to ResponseEntity<T> class .
I have seen people recommend to use Regular expression as a solution to refactor all the methods.
I need to know your opinion about implementing Regex as solution in terms of advantages / drawbacks for using regex in this scenario.
In addition it would be helpful if you can suggest other solutions.
please take a look at the attached code for more details.
return Model object to the view
@GetMapping("/getData")
public String getData(Model model) {
model.addAttribute("message", "springMvc");
return "viewPage";
}
return ResponseEntity object as a json format
@GetMapping("/getData")
public ResponseEntity<Map<String,String>> getData() {
Map<String,String> map = new HashMap<>();
map.put("message", "springMvc");
return new ResponseEntity.Ok().body(map);
}