문제

I have a URI like this: http://localhost:8111/myService/{Param1}/{Param2}/Param3

Param1, Param2, Param3 may or may not contains special characters such as #, &, @, /

I am having the clients encode these special characters such as using %2F for /

On the restlet side I am then using string replace to decode these characters. param2.replaceAll("%2F", "/")

Is there a better way to do this to auto interpret these encoded characters?

도움이 되었습니까?

해결책

The following seems to have taken care of it for me ...

(Reference.decode((String)request.getAttributes().get("Param2")))

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