This week's book giveaways are in the Refactoring and Agile forums.
We're giving away four copies each of Re-engineering Legacy Software and Docker in Action and have the authors on-line!
See this thread and this one for details.
Win a copy of Re-engineering Legacy Software this week in the Refactoring forum
or Docker in Action in the Cloud/Virtualization forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

plus sign in the getParameter

 
Renato Losio
Ranch Hand
Posts: 99
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hello.

I have a web app where the user has to confirm the registration clicking on a URL link he has in the confirmation email. Something like:

http://myapplication.com/confirm_user?mob=89458454545

Everything runs fine but the mob value is a string that MAY start with a plus sign. And I run into problems as the String mob = request.getParameter("mob") doesn't return the plus.

Any quick fix?

Thanks,

Renato
 
Renato Losio
Ranch Hand
Posts: 99
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Forget about the post, I fixed it with a String mob= java.net.URLEncoder.encode(request.getParameter("mob"),"UTF-8");

Of course if you have a better idea, just add a comment :-)

Thanks anyway.

Renato
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic