About a multi page web application

23 views
Skip to first unread message

MaveriK

unread,
Jun 1, 2010, 5:16:48 AM6/1/10
to Google Web Toolkit
Hi everyone.

I'm new in GWT, i've just begun to use GWT a couple of week ago.
My goal is to create a web app that shows a login page, and after the
log-in shows an interface where the user can interact with the system

So i was wondering if i need need a multi-page web app, or instead a
single-page switching the visibility of widgets on/off.
I though the first was the best solution as i don't have lots widgets
to manage in one page, but i can't fine a way to make multi-page web
app in GWT...
I read some posts from GWT discussion but i couldn't find out how to
do it.
Could someone help me out?

Tnx in adv

Tristan

unread,
Jun 3, 2010, 3:05:59 AM6/3/10
to Google Web Toolkit
there are lots of way to do this.

first there are a lot frameworks that use MVP (GWTP comes to mind,
handlebars which is my own plug, and bunch of others), but it's a lot
of work to learn.

for what you're doing perhaps you should consider using jsp's and then
embed GWT where you need to. so if you want to keep it really simple,
think html or jsp's using GWT for some of the widgets. if you want to
start getting complicated, then take a look at all the frameworks
available and let GWT control everything.

as to how to build it.. it could be nothing more than login being your
landing page, and on successful login you just call
Window.Location.assign("url/to/your/interface"); or something similar
(naturally you'd want to make sure that any requests to url/to/your/
interface were part of an authorized session).

Stefan Bachert

unread,
Jun 3, 2010, 5:53:15 AM6/3/10
to Google Web Toolkit
Hi,

GWT-application are in general single page applications (like any Ajax-
application).
When you for some reason need more the one browser window, you should
communicate via the server.
However, this should not be a topic for a starter.

Stefan Bachert
http://gwtworld.de

ping2ravi

unread,
Jun 3, 2010, 6:56:27 AM6/3/10
to Google Web Toolkit
Few days back i was thinking about the same thing(How to do Multipage
it in GWT) and finally i got the solution.

First i would suggest you to stay away from creating mutiple jsp pages
and then embedding one or two widgets in left right etc. I tried that
and it doesn't give the best user experience.
Following thing happens when you mix jsp and GWT
1) First server request to retrieve jsp/HTML page
2) Then it start downloading all the HTML content like images and
scripts,some time GWT scripts are quite big if you use some other
framework like gwtext etc)
3) Once everything is loaded browser fire default javascript
function(onModule from your GWT class).
4) Atleast one more call to server again to retrive data from server
to show it in GWT.(if you want to show some data)

Now user go to different page and the four steps will repeat(ofcourse
script cache can be used but still)

So for above reasons i would not mix JSPs with GWT. Either just JSP or
just GWT.

Now before thinking about multipage, you need to think why u want
multipage. If its a website then you might need a multipage design but
if its a application like any desktop application then i would
recommend not to think about multipage view.

For desktop Application like, you can create one mainPanel(basically
just a verticalPanel or anything like that), and add it your HTML
using RootPanel.get().add();
And then whenever user choose something always do this (use mainPanel
and not RootPanel.get().add())
Say u want to show Login
mainPanel.clear();
mainPanel.add(new LoginPanel());

Say u want to show Screen1Panel
mainPanel.clear();
mainPanel.add(new Screen1Panel());

etc etc


But say now u decided to go with multipage then you can implement it
using History.More details you can find on this thread. Basically you
will need to learn bit more about history and it will give your
website a very good and fast user experience.

http://groups.google.com/group/google-web-toolkit/browse_thread/thread/80c27e2d7d06d972


Thanks,
Ravi.





On Jun 3, 10:53 am, Stefan Bachert <stefanbach...@yahoo.de> wrote:
> Hi,
>
> GWT-application are in general single page applications (like any Ajax-
> application).
> When you for some reason need more the one browser window, you should
> communicate via the server.
> However, this should not be a topic for a starter.
>
> Stefan Bacherthttp://gwtworld.de
Message has been deleted

MaveriK

unread,
Jun 15, 2010, 2:47:55 AM6/15/10
to Google Web Toolkit
first of all, TNX to everyone!

sorry i didn't replied quicker, but i've been a bit busy and i've "got
a pause" with gwt :)

As ping2ravi suggested, i decided to use panels and attach them to the
mainPanel.
To avoid a single-page-full-code, i made a class for each panel so i
can distribuite code, and then i attach an istance of the class i need
to the mainPanel.
Still i'm not sure the best way to do this as i faced some problems,
but i tryed some basic panel switching, and they seems to work.
If someone is interested, i'll post how i try to manage the panel
switching
Reply all
Reply to author
Forward
0 new messages