Home > OS >  javax validation has be replaced by jakarta validation, then validation can't work
javax validation has be replaced by jakarta validation, then validation can't work

Time:11-28

    @RequestMapping(value = "/v3/{versionId}/start/info/{type}", method = RequestMethod.GET,
        headers = "Content-Type=application/json", produces = "application.json")
    public ResponseEntity<Response> getStartInfo(
            @RequestHeader(value = "X-language") String language,
            @RequestParam(Required = false)
            @Pattern(regexp = RegexPattern.TYPE, message = "DBS.280232") String type,
            HttpServletRequest request
    ) {

we use "javax.validation.constraints.Pattern" class at first, but our credibility told us can't use javax any more, so we replace it to "jakarta.validation.constraints.Pattern", but it can't validate param. (the param "type" is from url)

Has anyone come across this before,thanks!

CodePudding user response:

Spring Boot 2.X does not support Jakarta EE, but support will come with Spring Boot 3.X. https://github.com/spring-projects/spring-boot/wiki/Spring-Boot-3.0.0-M1-Release-Notes

  • Related