0

Background:

I am creating a url with BASE64 encoded parameter

http://localhost:80/OSSRS/faces/public/createAccount.jsf?v=3oucxMUPtl7n+R6ODZbjcJ9HSo7boNqSnL+HJ9mHcpvfgmhqmCIMa1psTxuaPS6b

This url has a parameter 'v' with the value '3oucxMUPtl7n+R6ODZbjcJ9HSo7boNqSnL+HJ9mHcpvfgmhqmCIMa1psTxuaPS6b'. And this param value has got a plus(+) characters in it.

Issue:

When I read this URL parameter 'v' in my Java servlet code, then the '+' becomes spaces.

   //Read the parameter from URL
   String encryptedVal = FacesContext.getCurrentInstance().getExternalContext().getRequestParameterMap().get("v");
   System.out.println( "v = " + encryptedVal);

The code prints

v = 3oucxMUPtl7n R6ODZbjcJ9HSo7boNqSnL HJ9mHcpvfgmhqmCIMa1psTxuaPS6b

All the plus in the param v got converted to space.

I want to retain the plus sign as plus when I read value from the url.

Cœur
  • 37,241
  • 25
  • 195
  • 267
user1455719
  • 1,045
  • 4
  • 15
  • 35

0 Answers0