If I encode the URL on client side, the other url delimiters are encoded. The other option is to extract the custId part and encode and append again to URL and send to server. On the server side, I decode it again to get the original custId. Is there a way where I can avoid this explicit encoding/decoding. ?
i think other option can be to use Servlet Filters.
You can catch all your incoming requests in Filter and then perform URL encoding with required character coding scheme. after that request will contine to go forward to required servlet/action/controller class.
in this way, all your encoding stuff is at one place in your application