Integrate GWT, spring, strtus, and Hibernate

Source: Internet
Author: User

GWT can be combined with Struts, spring, and hibernate for web development. In GWT, struts, spring, and hibernate use the same method as SSH integration. You can refer to the integration of the SSH development framework, for the integration of GWT and struts, refer to the following URL:

Http://code.google.com/p/struts2gwtplugin/wiki/ZeroConfig

Http://code.google.com/p/struts2gwtplugin/wiki/Howtouse

Download struts2gwtplugin (http://code.google.com/p/struts2gwtplugin), add the following package in the Struts. xml file, and configure

<Package name = "gwtrpc" extends = "GWT-Default">
<Action name = "listcategoryservice" class = "action class name">
<Interceptor-ref name = "GWT"/>
</Action>
</Package>

 

 

The Action Implementation class is the server class. You must first define the interface for asynchronous communication in the client (package), and then the server class implements the functions defined in this interface, similar to the servlet created by asynchronous communication in GWT.

For specific examples, refer to the Cross-step debugging example written in http://hgflybird.javaeye.com/blog/353636.

 

 

Parameter transfer between module pages generated by GWT

 

A gwt module corresponds to an HTML page. If two HTML pages communicate and PASS Parameters, you can call the jsni function in GWT and use the window of <SCRIPT> On the HTML page. location. search? To obtain the parameter! You can call the jsni function at the entry point of GWT to obtain the parameters passed on the page. The usage is as follows:

/**
* Open a new window.
* @ Param URL
*/
Public static native void opennewwindow (string URL )/*-{
$ WND. Open (URL );
}-*/;
 
/**
* Get current browser URL parameters string.
* @ Return
*/
Public static native string geturlparamstr ()/*-{
Return $ WND. Location. Search. substr (1 );
}-*/;

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.