Display the contents of an external URL

775 views
Skip to first unread message

Chad Bourque

unread,
Sep 7, 2006, 4:27:33 PM9/7/06
to Google Web Toolkit
Hi all,

I've searched for this and haven't been able to find anything conclusive. I want to be able to display an external (or internal for that matter) web page inside a GWT component. Obviously, it seems that HTMLPanel would do this, but it doesn't take a URL anywhere, only the actual HTML to display. That would be fine if someone could tell me how to get the HTML from a URL.

TIA,
Pilot Fox

Eric B

unread,
Sep 7, 2006, 4:33:41 PM9/7/06
to Google Web Toolkit
Use HTTPRequest to (asynchronously) get the page you want, then add the
html to your widget.

Thanks,
Eric

Chad Bourque

unread,
Sep 7, 2006, 4:51:40 PM9/7/06
to Google-We...@googlegroups.com
Eric,

Thanks. That's exactly what I was looking for. I knew it had to be simple. ;)

Chad Bourque

unread,
Sep 8, 2006, 11:52:47 AM9/8/06
to Google-We...@googlegroups.com
Eric (or anyone else),

I've got a page loading inside a widget on my page, but I have a couple of issues with it:
  1. I get a security alert asking if I can continue to load the page since it is requesting data from another server. Is there a way to tell my app that the other domain is safe or is that all client side security concerns that I have no control over?
  2. After the content loads, I get an error (shown below). Do I need to add entries to my config files to avoid this or am I still missing some steps?
  3. Should I be pulling the external data on the server and getting it to the client via RPC instead of just HTTPRequest.getAsync()?
[ERROR] Unable to find 'TMMobile.gwt.xml' on your classpath; could be a typo, or maybe you forgot to include a classpath entry for source?

TIA,
Chad

Jason Essington

unread,
Sep 8, 2006, 12:01:18 PM9/8/06
to Google-We...@googlegroups.com
one option is to load the html into a frame in your widget ...

you can just construct the frame new Frame("http://my.external.url/
foo/bar")

-jason

Chad Bourque

unread,
Sep 8, 2006, 12:14:39 PM9/8/06
to Google-We...@googlegroups.com
Jason,

Thanks. That works, but I still get a (different) security confirmation. This says that I can disable by adding the site to the whitelist via:

-whitelist=" ^http[:][/][/]tmwebdev"

Where do I put that?

TIA,
Chad

Jason Essington

unread,
Sep 8, 2006, 12:52:15 PM9/8/06
to Google-We...@googlegroups.com
That sounds like a browser issue rather than a GWT one ...
what browser are you using?

-jason

Chad Bourque

unread,
Sep 8, 2006, 1:46:52 PM9/8/06
to Google-We...@googlegroups.com
I get that in Hosted mode. I develop on Windows XP and I'm pretty sure it runs hosted mode using IE's rendering engine.

Chad

rlogman

unread,
Sep 9, 2006, 11:44:56 PM9/9/06
to Google Web Toolkit
I have the same problem, under linux (Ubuntu Hoary).

The message appears like a simple warning, but I can not make any
asynchronous calling.

rlogman

unread,
Sep 9, 2006, 11:47:23 PM9/9/06
to Google Web Toolkit
I was able to correct it.. the place to write "-whitelist..." is in
your launcher file.

Rodrigo.

Reply all
Reply to author
Forward
0 new messages