Skip to content
Snippets Groups Projects
Commit 6495094c authored by Otto Visser's avatar Otto Visser
Browse files

Merge branch '255-validation-was-not-triggering' into 'development'

Ensure all controllers that use validation also have @Validated

Closes #255

See merge request !191
parents 96f2ae80 dbee7c92
Branches
Tags
2 merge requests!201Development,!191Ensure all controllers that use validation also have @Validated
...@@ -28,12 +28,14 @@ import org.springframework.beans.factory.annotation.Autowired; ...@@ -28,12 +28,14 @@ import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.security.access.prepost.PreAuthorize; import org.springframework.security.access.prepost.PreAuthorize;
import org.springframework.stereotype.Controller; import org.springframework.stereotype.Controller;
import org.springframework.ui.Model; import org.springframework.ui.Model;
import org.springframework.validation.annotation.Validated;
import org.springframework.web.bind.annotation.*; import org.springframework.web.bind.annotation.*;
import org.springframework.web.multipart.MultipartFile; import org.springframework.web.multipart.MultipartFile;
import org.springframework.web.servlet.mvc.support.RedirectAttributes; import org.springframework.web.servlet.mvc.support.RedirectAttributes;
@Controller @Controller
@PreAuthorize("@permissionService.isAdmin(principal)") @PreAuthorize("@permissionService.isAdmin(principal)")
@Validated
public class AdminController { public class AdminController {
@Autowired @Autowired
......
...@@ -62,6 +62,7 @@ import org.springframework.security.access.prepost.PreAuthorize; ...@@ -62,6 +62,7 @@ import org.springframework.security.access.prepost.PreAuthorize;
import org.springframework.stereotype.Controller; import org.springframework.stereotype.Controller;
import org.springframework.ui.Model; import org.springframework.ui.Model;
import org.springframework.validation.BindingResult; import org.springframework.validation.BindingResult;
import org.springframework.validation.annotation.Validated;
import org.springframework.web.bind.WebDataBinder; import org.springframework.web.bind.WebDataBinder;
import org.springframework.web.bind.annotation.InitBinder; import org.springframework.web.bind.annotation.InitBinder;
import org.springframework.web.bind.annotation.ModelAttribute; import org.springframework.web.bind.annotation.ModelAttribute;
...@@ -75,6 +76,7 @@ import org.springframework.web.servlet.mvc.support.RedirectAttributes; ...@@ -75,6 +76,7 @@ import org.springframework.web.servlet.mvc.support.RedirectAttributes;
import com.querydsl.core.types.dsl.BooleanExpression; import com.querydsl.core.types.dsl.BooleanExpression;
@Controller @Controller
@Validated
public class CourseController { public class CourseController {
@Autowired @Autowired
......
...@@ -57,11 +57,13 @@ import org.springframework.security.access.prepost.PreAuthorize; ...@@ -57,11 +57,13 @@ import org.springframework.security.access.prepost.PreAuthorize;
import org.springframework.stereotype.Controller; import org.springframework.stereotype.Controller;
import org.springframework.ui.Model; import org.springframework.ui.Model;
import org.springframework.validation.BindingResult; import org.springframework.validation.BindingResult;
import org.springframework.validation.annotation.Validated;
import org.springframework.web.bind.WebDataBinder; import org.springframework.web.bind.WebDataBinder;
import org.springframework.web.bind.annotation.*; import org.springframework.web.bind.annotation.*;
import org.springframework.web.servlet.mvc.support.RedirectAttributes; import org.springframework.web.servlet.mvc.support.RedirectAttributes;
@Controller @Controller
@Validated
public class LabController { public class LabController {
private static final Logger logger = LoggerFactory.getLogger(LabController.class); private static final Logger logger = LoggerFactory.getLogger(LabController.class);
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please to comment