• 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

Spaces in http connection

 
Greenhorn
Posts: 8
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi all, I have the following problem: I have a Midlet running on the cellphone where the user enter some information. This info is saved in a recordstore which I parsed into String in order to transfer the data (through http) to a servlet running on the desktop PC.
The problem is that in the recordsStore there are blanks and before I transfer the data I must remove its, if not I get an error like this:
"illegal URL: does not allow blanks".

Any idea how to solve it ?
Thanks.
 
ranger
Posts: 17347
11
Mac IntelliJ IDE Spring
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Do they have to be stored in the RecordStore with spaces?

And isn't there a way to send a parameter in a URL that has spaces, using the &sp or whatever that "&" plus is for space.

But in that case you will have to replace the spaces with that character.

Mark
 
Greenhorn
Posts: 7
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi, we recently have the same trouble but with us this problem made the phone restart it. When we started to debug the program we saw the space was built into the System.out.println() wich is use to print the url and the parameters. If we comment this line of code the trouble dissapear. We never found spaces in the memory of the phone we suppose this space is making by another proccess.

Just a question, Are you using a parser to Ascii from the String you have? I mean the http sometimes does not recieve correctly a String if it's not parser with ascii codes.
Ex.
<P V="E"> //With out parser the string
<P%20V="E"> //Parsing the string by the phone before the request comes out .
If you see we have %20 that means a space in ascii.

Grettings.
 
reply
    Bookmark Topic Watch Topic
  • New Topic