• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

URLEncode limits

 
Greenhorn
Posts: 1
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I have a quick question, and I may actually be in the wrong forum for this. I'm creating an image using a java servlet and posting it to our web page, using the following code:
**This is code from the servlet that is creating the dataset**
String sChartInfo = "img src=\"/coal0000/GraphData";
sChartInfo += "?title=" + URLEncoder.encode(sTitle);
sChartInfo += "&chart=" + URLEncoder.encode(sGraphType);
sChartInfo += "&dataSet=" + URLEncoder.encode(sDataSet);
sChartInfo += "width=\"700\" height=\"700\" border=\"2\"";
***the string sChartInfo is replacing a comment block in our HTML webpage***
My question is, Is there a limit to the amount of data that I can pass back to the servlet that is creating the image, if it is a doGet method ? If there is a limit, is there any way that I can get around it ? I was thinking about the doPost, but I'm not sure how to post to the servlet in a query stream like that.
Thanks.
 
Ranch Hand
Posts: 3695
IntelliJ IDE Java Ubuntu
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I'm thinking you're asking about the maximum length of the entire URL, and not just a single URLEncoded parameter?

Here is the official word on IE:
http://support.microsoft.com/default.aspx?scid=http://support.microsoft.com:80/support/kb/articles/Q208/4/27.ASP&NoWebContent=1

Other browsers may not have these limits, as the official HTTP 1.1 spec imposes no minimums or maximums.

It might also be server dependant (perhaps some implementations of servlet runners or web servers will truncate, perhaps not).

POSTing is the recommended alternative, but you can't (to my knowledge) fake a POST for an http request for images via an anchor tag.
[ February 10, 2004: Message edited by: Mike Curwen ]
 
I don't always make ads but when I do they're tiny
a bit of art, as a gift, that will fit in a stocking
https://gardener-gift.com
reply
    Bookmark Topic Watch Topic
  • New Topic