Commit 6674581d authored by Matija Obreza's avatar Matija Obreza

Let spring handle errors

parent 9ffd9cb8
......@@ -41,6 +41,7 @@ import org.springframework.validation.BindingResult;
import org.springframework.validation.FieldError;
import org.springframework.validation.Validator;
import org.springframework.web.bind.annotation.ModelAttribute;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
......@@ -171,4 +172,9 @@ public class HtmlController extends BaseController {
public void accessDenied() {
throw new AccessDeniedException("Spring Security denied access to the resource.");
}
@RequestMapping(value = "/errors/{code}")
public String errorHandler(@PathVariable("code") int code) {
return "/errors/error";
}
}
......@@ -243,19 +243,19 @@
<error-page>
<error-code>401</error-code>
<location>/WEB-INF/jsp/errors/401.jsp</location>
<location>/errors/401</location>
</error-page>
<error-page>
<error-code>404</error-code>
<location>/WEB-INF/jsp/errors/404.jsp</location>
<location>/errors/404</location>
</error-page>
<error-page>
<error-code>500</error-code>
<location>/WEB-INF/jsp/errors/500.jsp</location>
<location>/errors/500</location>
</error-page>
<error-page>
<error-code>503</error-code>
<location>/WEB-INF/jsp/errors/503.jsp</location>
<location>/errors/503</location>
</error-page>
<session-config>
<session-timeout>30</session-timeout>
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment