Win a copy of Svelte and Sapper in Action this week in the JavaScript forum!
  • 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 all forums
this forum made possible by our volunteer staff, including ...
  • Campbell Ritchie
  • Ron McLeod
  • Paul Clapham
  • Bear Bibeault
  • Junilu Lacar
  • Jeanne Boyarsky
  • Tim Cooke
  • Henry Wong
Saloon Keepers:
  • Tim Moores
  • Stephan van Hulst
  • Tim Holloway
  • salvin francis
  • Frits Walraven
  • Scott Selikoff
  • Piet Souris
  • Carey Brown

Spaces in http connection

Posts: 8
  • Mark post as helpful
  • send pies
  • 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 ?
Posts: 17346
Mac IntelliJ IDE Spring
  • Mark post as helpful
  • send pies
  • 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.

Posts: 7
  • Mark post as helpful
  • send pies
  • 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.
<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.

Hey cool! They got a blimp! But I have a tiny ad:
the value of filler advertising in 2020
    Bookmark Topic Watch Topic
  • New Topic