• 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

JSF import contents of a HTTP call

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

is there a way to import the contents of a HTTP call response into a HTML page? i.e. if i was to make a call to www.google.ie and to import this page into another HTML page,

Thanks,

Niall
 
Saloon Keeper
Posts: 27763
196
Android Eclipse IDE Tomcat Server Redhat Java Linux
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Probably the easiest way to do this is to use frames. Of course, the Elite will sneer at you, and JSF isn't very supportive of frames, but it's still sometimes the simplest solution.

However, since frames are managed solely by the client, if the webapp itself needs to know anything about this HTML stream, then you'll need code in the webapp to do an HTTPURLRequest to the secondary server. Then you'll need to figure out what to do with the returned output. That generally would mean doing something like removing the HTML and HEAD tags and outputting the remainder (suitably reformatted) in an outputText with "escape="false"" set.

On the other hand, you're talking Google, here, and Google is big on web service APIs, so you might just be better off finding one that returns the raw date, then create your own local version of the display.
 
With a little knowledge, a cast iron skillet is non-stick and lasts a lifetime.
reply
    Bookmark Topic Watch Topic
  • New Topic