GWT for individual HTML pages?

I am new to GWT and am going to develop a user interface for a user application using GWT. I plan to use an existing module created using Spring / Hibernate. I figured out how to integrate GWT with Spring, but I'm not sure how to design the layout.

I want two pages:

  • User registration page (want to embed the GWT widget in HTML)
  • Administration page (separate HTML code, as indicated above, with built-in GWT widgets)
  • I plan to use Spring Security, should I use a simple JSP login page or use an RIA GWT login widget?

What can I use for the above requirements? multiple GWT modules?

+5
source share
2 answers

You can make 2 modules, one for the login widget and one more for the admin widget. Each widget will embed itself in a div depending on which html (or jsp) page you need.

For example, create * .gwt.xml for each module, for example: login.gwt.xml and admin.gwt.xml. These files must be created in the root directory of your gwt, for example com.gwt.example.

Then create an Entry Point class for each (each class will implement EntryPoint ). For example, Login.java might look like this:

package com.gwt.example.myproject.client;

public class Login implements EntryPoint {

  public void onModuleLoad() {
    ... create loginWidget ..

    RootPanel.get("my-login-div").add(loginWidget);

  }

}

So, now that you are compiling gwt, it should create a bunch of files in war/com.gwt.example. You are interested in com.gwt.example.login.nocache.jsand com.gwt.example.admin.nocache.js.

js- html / jsp .

, html, :

<html>
....other stuff...
<script type="text/javascript" language="javascript" src="com.gwt.example.login.nocache.js"></script>
....other stuff....
<div id="my-login-widget"></div>
....the rest of your html markup....
</html>

, html, gwt javascript, , onModuleLoad, div id = "my-login-widget" .

Spring Security, , , , Spring ajax.

+12

.

, , , . , . 100% - . , , . ... GWT 2.0.

+1

All Articles