| Author |
decoding URL values
|
Suresh Khant
Ranch Hand
Joined: Feb 27, 2010
Posts: 100
|
|
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]
|
 |
Bear Bibeault
Author and opinionated walrus
Marshal
Joined: Jan 10, 2002
Posts: 50693
|
|
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.
|
[Smart Questions] [JSP FAQ] [Books by Bear] [Bear's FrontMan] [About Bear]
|
 |
Suresh Khant
Ranch Hand
Joined: Feb 27, 2010
Posts: 100
|
|
Thanks for your reply,
I have used the UrlDecoder
but getting squares
|
 |
Paul Clapham
Bartender
Joined: Oct 14, 2005
Posts: 13842
|
|
|
Well, of course you are. What did you expect to get from %06?
|
 |
 |
|
|
subject: decoding URL values
|
|
|