Redirect to referer on Error #8
If `onError` is not set, the default referer will be used.pull/21/head
parent
daea4c04ca
commit
a284b8f9c8
|
@ -29,7 +29,8 @@ public class MessageFormController {
|
||||||
BindingResult bindingResult) {
|
BindingResult bindingResult) {
|
||||||
|
|
||||||
if(bindingResult.hasErrors()) {
|
if(bindingResult.hasErrors()) {
|
||||||
return "redirect:" + form.getOnError();
|
String onError = (form.getOnError() != null ? form.getOnError() : referer);
|
||||||
|
return "redirect:" + onError;
|
||||||
}
|
}
|
||||||
|
|
||||||
String token = form.getToken();
|
String token = form.getToken();
|
||||||
|
|
Loading…
Reference in New Issue