Skip to content
Snippets Groups Projects
Commit ae9085de authored by Mic's avatar Mic
Browse files

added CrashController to showcase behaviour when exception occurs

parent 2df7267a
No related branches found
No related tags found
No related merge requests found
package org.springframework.samples.petclinic.web;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
/**
* Controller used to showcase what happens when an exception is thrown
*
* @author Michael Isvy
*/
@Controller
public class CrashController {
@RequestMapping(value="/oups", method = RequestMethod.GET)
public String triggerException() {
throw new RuntimeException("Something went wrong...");
}
}
......@@ -66,7 +66,8 @@ public class OwnerController {
@RequestMapping(value = "/owners/find", method = RequestMethod.GET)
public String initFindForm(Model model) {
throw new RuntimeException("aaaaaaa");
model.addAttribute("owner", new Owner());
return "owners/findOwners";
}
@RequestMapping(value = "/owners", method = RequestMethod.GET)
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment