add html page

16 views
Skip to first unread message

canistel

unread,
Jun 23, 2008, 9:59:27 AM6/23/08
to Google Web Toolkit
Hi, I started using GWT last week and I am very happy with the toolkit
in general... One thing I haven't figured out yet (which the doc's
don't explain as far as I can see) is how to add another "page" to the
project. I mean I can add a web page in eclipse, but how do I "inform
GWT" that I want to treat this page as a gwt page, with all the
features like widgets, rpc etc?
Thanks in advance.

Isaac Truett

unread,
Jun 23, 2008, 1:47:01 PM6/23/08
to Google-We...@googlegroups.com
Add a script tag referencing your nocache.js bootstrap file, just as
you did for the first page.

But you should ask yourself why you're trying to add a second HTML
file in the first place. Do you really want to throw away all of your
current client-side state and download another hunk of HTML?

canistel

unread,
Jun 23, 2008, 3:28:33 PM6/23/08
to Google Web Toolkit
> But you should ask yourself why you're trying to add a second HTML
> file in the first place. Do you really want to throw away all of your
> current client-side state and download another hunk of HTML?

Probably not :) So then how does one build a (large) web application
using gwt? Does it all get contained in the one page? Do we just treat
the main page as we would a "main class" in java desktop application
and just add classes whenever needed / desired?

Isaac Truett

unread,
Jun 23, 2008, 3:46:28 PM6/23/08
to Google-We...@googlegroups.com
Basically, yes. That's not your only option; there are many very good
reasons for wanting more individual HTML pages in a web *site* (such
as making content available to search engines or insufficiently
JS-compatible browsers) but for most web *applications* you can
probably just use a single HTML file as a launching point for your
app.

If you compare a GWT app to a desktop application then navigating to a
new HTML page and loading a new (or even the same) GWT module would be
sort of like having ProgramA.exe shut itself down and run ProgramB.exe
in order to show a different "screen" to the user. You would have to
go through loading a new program into memory, reinitializing whosits
and whatits, etc. In most cases it's going to be simpler for
ProgramA.exe to have the capability of showing both screens.

canistel

unread,
Jun 24, 2008, 1:25:00 PM6/24/08
to Google Web Toolkit
That makes sense I guess, thanks.


On Jun 23, 3:46 pm, "Isaac Truett" <itru...@gmail.com> wrote:
> Basically, yes. That's not your only option; there are many very good
> reasons for wanting more individual HTML pages in a web *site* (such
> as making content available to search engines or insufficiently
> JS-compatible browsers) but for most web *applications* you can
> probably just use a single HTML file as a launching point for your
> app.
>
> If you compare a GWT app to a desktop application then navigating to a
> new HTML page and loading a new (or even the same) GWT module would be
> sort of like having ProgramA.exe shut itself down and run ProgramB.exe
> in order to show a different "screen" to the user.  You would have to
> go through loading a new program into memory, reinitializing whosits
> and whatits, etc. In most cases it's going to be simpler for
> ProgramA.exe to have the capability of showing both screens.
>
Reply all
Reply to author
Forward
0 new messages