aspose file tools
The moose likes Servlets and the fly likes encoding with URLEncoder Big Moose Saloon
  Search | Java FAQ | Recent Topics
Register / Login


Win a copy of The Mikado Method this week in the Agile and other Processes forum!
JavaRanch » Java Forums » Java » Servlets
Reply Bookmark "encoding with URLEncoder " Watch "encoding with URLEncoder " New topic
Author

encoding with URLEncoder

mandar kharat
Greenhorn

Joined: Feb 08, 2002
Posts: 4
I am trying to encoding a large data(2.5MB) with URLEncoder class. But there is not output from the class,i.e. String. Is there any restriction for the size of data Encoding with this class. Has anyone come across this problem?
Bear Bibeault
Author and ninkuma
Marshal

Joined: Jan 10, 2002
Posts: 56221
    
  13

You didn't mention why you were trying to do this. The only reason to URL encode something is to be able to use it as part of a URL. Now, if you are trying to pass a 2.5M string as a request parameter encoded in the query string of a URL as part of a GET, well, that's way too large.
What exactly are you trying to accomplish?
bear


[Smart Questions] [JSP FAQ] [Books by Bear] [Bear's FrontMan] [About Bear]
mandar kharat
Greenhorn

Joined: Feb 08, 2002
Posts: 4
I am trying to do this to send the data over the wire, to another servlet with HttpUrlConnection . I am transmitting this data after establishing a connection with this remote servlet, for that reason I have to encode this data using URLEncoder.
Mike Curwen
Ranch Hand

Joined: Feb 20, 2001
Posts: 3695

Bear, you were confusing the EncodeURL() method of the HttpServletResponse with the java.net.URLEncoder class.

mandar, I'm not really sure you need to use URLEncoder. If the 2.5MB file you are sending has a ' ' (space) character in it, does it make sense to turn this into a '+' character? You'd only have to use URLDecoder at the other end. Maybe it's a requirement to encode anything going over HTTP, but I thought that sending files as a stream of bytes "as is" was acceptable.
 
I agree. Here's the link: http://ej-technologies/jprofiler - if it wasn't for jprofiler, we would need to run our stuff on 16 servers instead of 3.
 
subject: encoding with URLEncoder
 
Similar Threads
Data encoding when using HttpURLConnection to POST data
UTF8 Support in Ruby on Rails but not Java?
How to convert query parameter of an url to UTF-8 format.
decode the string server side which is received from the client side
HTML Encoding in Java