diff --git a/src/main/java/org/springframework/samples/petclinic/web/CrashController.java b/src/main/java/org/springframework/samples/petclinic/web/CrashController.java new file mode 100644 index 0000000000000000000000000000000000000000..1a77ea42e61cc837e2b12cf90a58210b0f69e74b --- /dev/null +++ b/src/main/java/org/springframework/samples/petclinic/web/CrashController.java @@ -0,0 +1,23 @@ + +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..."); + } + + + +} diff --git a/src/main/java/org/springframework/samples/petclinic/web/OwnerController.java b/src/main/java/org/springframework/samples/petclinic/web/OwnerController.java index 77bf6b579fdf1461dda116dbcb5bf37410480c12..a7f760a97b423403c1742a3db223a3774c4576b3 100644 --- a/src/main/java/org/springframework/samples/petclinic/web/OwnerController.java +++ b/src/main/java/org/springframework/samples/petclinic/web/OwnerController.java @@ -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)