• Post Reply Bookmark Topic Watch Topic
  • New Topic

decoding URL values  RSS feed

 
Ranch Hand
Posts: 118
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi All,

I have a servlet which receives data

for example :

I have the following questions
Q1 : Is it possible to save the received data as it is , for above example , i want to data save as in database

Q2 : How to decode above Data to its original string ?

[Edit by Bear: added more descriptive subject]
 
Author and ninkuma
Marshal
Posts: 66690
167
IntelliJ IDE Java jQuery Mac Mac OS X
  • Likes 2
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator

Suresh Khant wrote:
Q1 : Is it possible to save the received data as it is , for above example , i want to data save as in database


Why? That doesn't seem like a reasonable thing to do.

In any case, the value will be automatically decoded by getParameter(). You can re-encode it, if you wish, with java.net.URLEncoder.

Q2 : How to decode above Data to its original string ?


As I said, this will happened automatically.

In general, to decode use java.net.URLDecoder.
 
Suresh Khant
Ranch Hand
Posts: 118
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thanks for your reply,

I have used the UrlDecoder



but getting squares




 
Sheriff
Posts: 23512
47
Eclipse IDE Firefox Browser MySQL Database
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Well, of course you are. What did you expect to get from %06?
 
Maybe he went home and went to bed. And took this tiny ad with him:
Rocket Oven Kickstarter - from the trailboss
https://coderanch.com/t/695773/Rocket-Oven-Kickstarter-trailboss
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!