I've created a basic server using Java servlets. What I'd like to do is implement a more liberal URI syntax by allowing non-alphanumeric characters in the URI's as long as they are %-hex encoded i.e two words.txt could be encoded as two%words.txt.
I'm not sure how to go about this. I've tried using java's .replace in the form of uri.replace(' ', '%') but this gives me a message format exception.