0

I am passing a String value from one jsp to another using the request.getParameterMap() method in Java. The String contains the HTML code for bullet '&bull' and when I use my debugger to step through I see that the '&bull' has been replaced by a '\u0095'149 and if I do a System.out.println() it appears as a question mark (?). Can someone please help me to figure out what is going on here?

Thank you in advance, Billy Blanks

billy_blanks
  • 105
  • 1
  • 3
  • 12
  • 1
    You can't literally have `•` in your request, since in a URL `&` is reserved as the separator between parameter names. You have to urlencode your parameter value if it contains `&`, so please show the actual url request query (i.e. the `?var1=x&var2=y` part of the url). – developerwjk Jan 09 '15 at 19:15
  • Thanks a lot for replying. I understand, but isn't it possible to do a replace all? Maybe something like [code] some_string.replaceAll("[\\\\u{1}]0095","[\\u]2022") [/code]. By the way, my regex isn't the greatest. I am having trouble catching \u0095. Did I make my regex correctly? – billy_blanks Jan 12 '15 at 19:07
  • What I'm saying is I doubt you are really sending the literal text `•` in your request from the client. The translation from `•` to the actual unicode character probably took place on the client before it sent the request. – developerwjk Jan 12 '15 at 19:25
  • I totally understand that the client is using \u0095 as a replacement. Now I want to catch that on the other jsp that I was referring to and replace the \u0095 with \u2022 (should be a round bullet). Will the replaceAll() work for that and if so, is my regex "above" correct? Thank you for your help. – billy_blanks Jan 12 '15 at 20:31

0 Answers0