The below is my sample controller.
@RequestMapping(value = "/validate", method = RequestMethod.POST)
public String validatePage1 (@ModelAttribute("page1")
Page1 pg1, BindingResult result) {
System.out.println("Value1:" + pg1.getVal1() +
"Value2:" + pg1.getVal2());
return "page2"; // I don't want to take any action (page navigation) here
}
@RequestMapping("/page1")
public ModelAndView pageShow() {
return new ModelAndView("page1", "command", new Page1());
}
Now the question is, I don’t want to take any action in the client side when the method (validatePage1) is called by Spring framework, how to do?
Actually I have loaded all required pages in my client side at loading time (to avoid repeated page load), so I dont want to take any page navigation action in the client side, I just want to do the ‘data binding’ to complete my business logic in server side.
When I return “” empty string in “validatePage1()”, Spring framework throws exception ” Request processing failed; nested exception is org.apache.tiles.definition.NoSuchDefinitionException:” since I am using tiles, I have to remove tiles configuration later since I am loading all files at first loading itself.
Straight from the documentation: