views:

8033

answers:

3

I get the following warning when using java.net.URLEncoder.encode:

warning: [deprecation] encode(java.lang.String)
         in java.net.URLEncoder has been deprecated

What should I be using instead?

+18  A: 

You should be using the other method in the URLEncoder class: URLEncoder.encode(String, String). The first parameter is the String to encode; the second is the name of the character encoding to use (e.g., "UTF-8").

Will Wagner
+1  A: 

thanks man it really helped me alot to understand

+1  A: 

See http://forums.sun.com/thread.jspa?threadID=5282950.

Ken