• 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
  • Liutauras Vilda
  • Tim Cooke
  • Jeanne Boyarsky
  • Paul Clapham
Sheriffs:
  • Devaka Cooray
  • Ron McLeod
  • paul wheaton
Saloon Keepers:
  • Tim Moores
  • Piet Souris
  • Tim Holloway
  • Stephan van Hulst
  • Carey Brown
Bartenders:
  • Al Hobbs
  • Frits Walraven
  • Scott Selikoff

Creating URL Objects

 
Ranch Hand
Posts: 118
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I'm trying to do something that seems relatively simple -- create a URL object from a String, such as:

<code>URL url = new URL("http://www.cnn.com");</code>

When I try to read the data from the URL with a method I've written, it works fine if I run it strictly on the client side of my client-server application. However, when I run it on the server, the URL seems to be erased and become empty (i.e. URL.getPath() = "").

The class that I use to read the URL has all static utility methods, so something like:

<code>String urlText = HTMLReader.readURL(url);</code> so I don't think Serialization should be an issue here.

Can anyone help to explain why this could be happening?

Thanks.
Jeff
 
Jeff Storey
Ranch Hand
Posts: 118
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
My fault -- it was a server lookup error. I've got it now.
 
This tiny ad is guaranteed to be gluten free.
the value of filler advertising in 2021
https://coderanch.com/t/730886/filler-advertising
reply
    Bookmark Topic Watch Topic
  • New Topic