Hi
I am trying to integrate, Seam and GWT. I was wondering if can specify html pages in Seam page flow. Is it possible ? If yes what will the name in the tranisition stand for ?
Hi
I am trying to integrate, Seam and GWT. I was wondering if can specify html pages in Seam page flow. Is it possible ? If yes what will the name in the tranisition stand for ?
Normally GWT is a client-side stateful application. This means that you run the entire application within one html page. Browser never reloads this page. If browser would reload this page then internal app state would be lost (variables, etc..).
Now, you can certainly create GWT application that has multiple html pages. Normally you would create different GWT modules and load them in separate html pages. Eclipse plugin creates a host page for every module.
You can create normal Seam application, just copy the necessary lines from GWT host pages to your Seam "pages".
Just keep in mind that this separate GWT modules share no state between them.
Edited:
You can map Seam page flow to GWT Buttons such that clicking the button takes you to the next page in pageflow:
view-id="page_url"
attribute inside <page>
element.This is a manual process (not type safe) that relies on you correctly matching view-id with URLs in Buttons. Change on one side will require you to manually correct the other side. To make life a bit easier you could make a function that adds a listener to Button (or any other Element in GWT).
We also use a combination of Seam page flow and GWT. Explicitly, we divide the login page from the main page to enable login via https. But, we do not use normal html pages, we still use xhtml pages. You can include a GWT html page within a Seam xhtml page by wrapping the <html></html>
pair with a <f:view></f:view>
pair:
<f:view
contentType="text/html"
xmlns="http://www.w3.org/1999/xhtml"
xmlns:f="http://java.sun.com/jsf/core"
xmlns:h="http://java.sun.com/jsf/html"
xmlns:s="http://jboss.com/products/seam/taglib"
xmlns:ui="http://java.sun.com/jsf/facelets">
<html>
<!-- ... -->
</html>
</f:view>
By using such a Seam wrapped html page, you do not have any trouble for defining the page transitions.
As Peter Knego already pointed out, it is advisable to use different GWT modules for different (x)html pages.
It heavily depends on what you're trying to achieve. That is whether you're planing to create a desktop like, single page application where most of the state is held by the client or the main logic as well as the html pages is provided by the server.
If you go for the desktop like app you're likely to build up the client-side of your app entirely with GWT. For the initial request Seam returns a simple html page that fetches the .nocache.js
which in return downloads the compiled main script .cache.html
of your app. From here GWT takes over (starting at onModuleLoad()
in the EntryPoint
of the loaded module) and builds up the entire layout of your app by replacing the <body>
tag of the returned html page. User interactions and state is synchronized via the server but rendering is done by GWT.
If you go for the combination of Seam and JSF you still can benefit from GWT. A common scenario is to selectively insert GWT widgets into specific places in a existing html page (see here for details). This way you can use Seam for rendering, page flow etc. and extend your pages with GWT widgets.
BTW, if you need SSL for the registration and/or user authentication (and automatic form completion!) I highly recommend to do it as recommended by @kraftan. Everything else is a pain.