Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.
Comment: Migration of unmigrated content due to installation of a new plugin

Name

GWT Plugin

Author

musachy

Publisher

Image Added, Sean McRae

License

Open Source (ASL2)

Homepage

http://code.google.com/p/struts2gwtplugin/

Version

0.12 stable

Compatibility

Struts 2.0.2+

State

Unstable

Homepage

http://code.google.com/p/struts2gwtplugin/

License

Open Source (ASL2)

Download

http://code.google.com/p/struts2gwtplugin/downloads/list

...

{rate:title=Rating|theme=dynamic}

This plugin excerptINLINE

can be used to call methods on Struts actions using Google Web Toolkit (GWT)

...

Example

Setup Action

Start by creating an action that contains the method that is going to be called. This method needs to match the signature of the service interface, but you don't need to implement the interface on the action. This method will be different from regular Struts 2 action methods in that it returns any object (that GWT can serialize), instead of a result name. If you want to call regular actions from GWT (not using GWT's RPC) go here

In this example the action "Hello" will return the string passed to it. Remember, the returned object is not the regular Struts result, it is the object that you will receive on the client side.

Example:

...

...

Write the mapping for the action

...

  1. Add the map inside a package that extends "gwt-default"
  2. Add the "gwt" interceptor to the mappingAdd a result of type "void" (doesn't do anything)

Example:

...

...

GWT classes

Write the required service interface as described here. This is regular GWT stuff.

As an example of the interface:

...

...

And to call it:

...

...

Installation

This plugin can be installed by copying the plugin jar and gwt-servlet.jar (from GWT) into your application's /WEB-INF/lib directory. No other files need to be copied or created.

Resources

(lightbulb) Struts + GWT without the GWT plugin

Version History

Version

Date

Author

Notes

0.1

Jul 2, 2007

Sean McRae

Updated plugin to work with the updated GWT 1.4 RPC mechanism. Add README file

0.1

Jan 10, 2007

musachy Image Added

Initial release