Question

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?

Was it helpful?

Solution

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

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

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top