I want to create an encoded URL for my site. Say for example, for this URL: \"http://google.com/index.html\"
I want to give this URL to the client by URL encoding it
The accepted answer is missing some JSP code to be valid, it should be:
Link to your client
As a comment pointed out, another option is to use JavaScripts encodeURIComponent method.