문제

@RequestMapping(value = "/user/search/{email}")
    public String auditUseremail(@PathVariable("email") String email,Map<String, Object> map) {

        System.out.println(email);
}

this is my conroller class function, which is called when the action is http://localhost:8080/LACASServer/secure/user/search/user@cohaesus.co.uk

as u can look, email is in URL, but when i print it in the above method, i get it user@cohaesus.co, can anybody tell me, what can be the issue and how to resolve it.

도움이 되었습니까?

해결책

I think you should use URL Encoding for this path and then decode it inside of controller

java.net.URLEncoder.encode(email, "ISO-8859-1");

You can read more about it here

라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top