This is a familiar ghost that reappears every fortnight. Whenever you are building a URL query string use url.append(someVariable); to append someVariable to url if you are sure that the variable contains only alphanumeric characters. use url.append(java.net.URLEncoder.encode(someVariable)); to append someVariable to url if someVariable may contain non-alphanumeric characters. It's safe to use URLEncoder.encode() even if the variable contains only alphanumeric characters. I hope this buries the URLEncoding ghost for a few weeks. Vivek -----Original Message----- From: Jan Hendrickx [mailto:[EMAIL PROTECTED]] Sent: Monday, July 10, 2000 9:10 AM To: [EMAIL PROTECTED] Subject: Re: URL, Encoding A URL can't contain white spaces (blanks) : convert them to "+" (plus signs). Use any of the URLencoder stuff or : quick and dirty String my_new_url = my_url.replace(' ','+'); Jan -----Original Message----- From: Balamurali A. [mailto:[EMAIL PROTECTED]] Sent: Monday, July 10, 2000 15:07 To: [EMAIL PROTECTED] Subject: URL, Encoding How should i encode my URL in Servlets. Here is an example. http://www.mapquest.com?street=W Plum St.&state=Ft. Collins. ..... it works fine in IE and dose'nt work with Netscape... Its there any other way to encode the URL? Any help is appriciated. Thanx in advance. Bala ________________________________________________________________________ Get Your Private, Free E-mail from MSN Hotmail at http://www.hotmail.com ___________________________________________________________________________ To unsubscribe, send email to [EMAIL PROTECTED] and include in the body of the message "signoff SERVLET-INTEREST". Archives: http://archives.java.sun.com/archives/servlet-interest.html Resources: http://java.sun.com/products/servlet/external-resources.html LISTSERV Help: http://www.lsoft.com/manuals/user/user.html ___________________________________________________________________________ To unsubscribe, send email to [EMAIL PROTECTED] and include in the body of the message "signoff SERVLET-INTEREST". Archives: http://archives.java.sun.com/archives/servlet-interest.html Resources: http://java.sun.com/products/servlet/external-resources.html LISTSERV Help: http://www.lsoft.com/manuals/user/user.html ___________________________________________________________________________ To unsubscribe, send email to [EMAIL PROTECTED] and include in the body of the message "signoff SERVLET-INTEREST". Archives: http://archives.java.sun.com/archives/servlet-interest.html Resources: http://java.sun.com/products/servlet/external-resources.html LISTSERV Help: http://www.lsoft.com/manuals/user/user.html
