• 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

URL Address

 
Greenhorn
Posts: 10
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi,

I have a URL www.abc.com/a b c

When I manually enter the URL address in the browser it works.

But when I code it in java and java automatically launch the browser, my URL will become www.abc.com/a%20b%20c which this does not fetch the data.

Please advice. Thanks.
 
Ranch Hand
Posts: 479
  • Likes 1
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
It is not legal to have a space in a URL. The %20 represents a space in an "encoded" URL, at least in some implementations/encoding schemes. If you are actually entering "a b c" at the end in a standard browser, and it is interpreting it as a URL, it is translating it somehow.

I do not know what your actual URL is, or your browser, or why something is (as you say) working in the browser and not in your program, etc. You don't give nearly enough detail about what is actually happening, so this is as much advice as I can offer. You could look at java's standard URLEncoder class, though it doesn't seem to translate spaces to %20 any more in its default encoding.

rc
 
Consider Paul's rocket mass heater.
reply
    Bookmark Topic Watch Topic
  • New Topic