I am new to Java and I am trying to write a utility API to encrypt / decrypt a string. I have my controller and request mapping, and I'm working in encrypt / decrypt mode.
The problem I have is decrypting a string in which there is a forward slash ('/'). If I leave unencoded in the URL (like If I change the URL to symbolic words (such as Also keep in mind that It seems that whenever I put '%' in the path variable, I get feedback Finds an empty page in I do not hit the method > I have simplified my decrypt method to output only the path variable, which is Can anyone explain to me what is happening and how can I work it out? Many thanks !! I have updated my encrypt method to use the function (vs just sign breaks versus 64 string) and also changed it to pass the data as a standard request param (I.e.? Data = string). This problem has been removed. The base 64 algorithm encodes the binary data using the URL-secured variation, but does not share the output. Emergence of url-secured variance - and instead of + and / character / note: no padding is added. http: // localhost: 8080 / api / package / util / decrypt / oJfTtchpM9WC / 4Oqpu7FZQ == ) then url routing breaks (which is clear why).
http: // localhost: 8080 / api / package / util / decrypt / oJfTtchpM9WC% 2F4Oqpu7FZQ == ) then the values in the path The variable is empty
http :. // localhost:. 8080 / api / package / util / decrypt / oJfTtchpM9WC (no slash) works fine
data < Pre>
@RequestMapping (value = "/ util / decrypt / {data}", method = RequestMethod.GET) @ResponseBody public string decrypt (HttpServletResponse HttpResponse, @PathVariable string data) throws exceptions {return data; // return URLDecoder.decode (data, "UTF-8"); }
No comments:
Post a Comment