내 컨트롤러는 다음과 같습니다.
@CrossOrigin(origins = "http://localhost:3000")
@RestController
@RequestMapping("/api/v1/employees")
public class EmployeeController {
@Autowired
private EmployeeService employeeService;
@GetMapping()
public List<Employee> getEmployeesBySearch(@Valid @ModelAttribute SearchDto searchDto) {
return employeeService.getEmployeesBySearch(searchDto);
}
}
내 SearchDto는 다음과 같습니다.
public class SearchDto {
private String firstName;
public String getFirstName() {
return this.firstName;
}
public void setFirstName(String firstName) {
this.firstName = firstName;
}
}
.
http://localhost:8080/api/v1/employees?firstName=%%%
http://localhost:8080/api/v1/employees?firstName=a%
http://localhost:8080/api/v1/employees?firstName=%a
내 GET 요청에 백분율 (%) 기호가있을 때마다 항상 null 값을 제공합니다.