Using Spring, I want to know in my @Controller
whether the request comes from the browser or not. If so, then put a particular treatment. I thought of using @RequestHeader (value = "User-Agent")
like this:
@RequestMapping(value = "/user-agent-test")
public String hello(@RequestHeader(value="User-Agent") String userAgent)
//toDo
if(browser){
//Make something
}else{
// Make something else
}
return "home";
}
But I do not know what condition I have to put. thank you in advance.