If no value is assigned to logout when clicking "/main?logout".Then your spring mvc controller with get request will have default value of logout as empty string (i.e "") , when it is read using @RequestParam.
Example: In below code it will print output as Logout parameter value is empty because if block is true as logout string is empty.
@GetMapping("/main")
public String handlingLogout(@RequestParam(value = "logout", required = false) String logout) {
if (logout.isEmpty()) {
System.out.println("Logout parameter value is empty" + logout);
}
return "main";
}
output : Logout parameter value is empty