I have a simple rest endpoint like this:
@RequestMapping(method = RequestMethod.GET, value = "/currencyCode")
public ResponseEntity<String> dummyEndpoint(@RequestParam("currencyCode") String currencyCode) {
return new ResponseEntity<>(currencyCode, HttpStatus.OK);
}
But when I call this with this http://localhost:8080/currencyCode?currencyCode=£
or this http://localhost:8080/currencyCode?currencyCode=€
, I get those responses: £
and €
. But for Dollar sign($), it works.
What should I do to get correct symbol using org.springframework.web.bind.annotation.RequestParam
?
EDIT: I have tried what @f1sh suggested, but I still have same problem.
((SecurityContextHolderAwareRequestWrapper) request).getRequest().getParameterMap().get("currencyCode")
returns â¬
still.
EDIT-2: I have 2 Connectors in my server.xml. They are like this:
<Connector port="8080" protocol="HTTP/1.1"
connectionTimeout="20000"
redirectPort="8443" URIEncoding="UTF-8"/>
and
<Connector port="8009" protocol="AJP/1.3" redirectPort="8443" URIEncoding="UTF-8"/>
I am using apache-tomcat-7.0.67 by the way.
Thanks...