wu created SHIRO-873:
------------------------

             Summary: Return to "404 not found" when controller uses annotation 
"@Validated".
                 Key: SHIRO-873
                 URL: https://issues.apache.org/jira/browse/SHIRO-873
             Project: Shiro
          Issue Type: Bug
          Components: Integration: Spring
    Affects Versions: 1.9.0
         Environment: OS: macos12.3
JDK: openjdk version "17.0.2" 2022-01-18 LTS
spring-boot-starter-web: 2.6.5
spring-boot-starter-validation: 2.6.5
shiro: 1.9.0
            Reporter: wu
            Assignee: Les Hazlewood


Integration spring-boot-starter-web 2.6.5 and  spring-boot-starter-validation 
2.6.5

 
use "authc" filter.
 
{quote}@RestController
@RequestMapping("/test")
@Validated
public class TestController {
    @PostMapping("/test")
    public String  test(@RequestParam @Min(10) Integer i) {
         return "test";
    }
}{quote}
 
When annotation @Validated on TestController,  link "/test/test" is return to  
"404  not found"{quote}{
"timestamp":"2022-03-25 13:21:51",
"status":404,
"error":"Not Found",
"path":"/test/test"
}{quote}
If don't ues  annotation @Validated, link mapping is right, but annotation 
@Min(10) to validate is not work.
 
if use  '@RequestBody' and '@Validated'  on method  parameter ,  it's worked..  
like this 
 
{quote}public class User {
    @Min(10)
    Integer id;
}
 
@RestController
@RequestMapping("/test1")
public class Test1Controller {
    @PostMapping("/test1")
    public String  test1(@Request @Validated User user) {
         return "test";
    }
}{quote}
 
 
please check it, thanks.
 



--
This message was sent by Atlassian Jira
(v8.20.1#820001)

---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to