Win a copy of The Little Book of Impediments (e-book only) this week in the Agile and Other Processes forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Spaces in http connection

 
Delmiro Costa
Greenhorn
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 ?
Thanks.
 
Mark Spritzler
ranger
Sheriff
Posts: 17278
6
IntelliJ IDE Mac 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.

Mark
 
Armando Miranda
Greenhorn
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.
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.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic