How to bring Spring Roo & GWT together

I am trying to develop a Spring Roo / GWT application with the latest GWT integration in Roo.

Getting scaffolding is easy, but I really don't understand how RPC works.

Can any of you provide a simple example of how to make a simple service for connecting a client / server in Spring Roo and GWT.

It would be very helpful to start, as I could not find any resource.

thanks and believes Flo

+3
source share
2 answers

Flo,

Not sure if you're on the google wave at all, but it seems like one place to save your ongoing efforts. In particular, this wave is available to the public: RequestFactory Wave

( ) API RequestFactory.

, . hibernate , GWT-RPC, / . . , RPC - .

RequestFactory, , Google, , , . , .roo - ApplicationRequestFactory.java.

package com.springsource.extrack.gwt.request;

import com.google.gwt.requestfactory.shared.RequestFactory;

public interface ApplicationRequestFactory extends RequestFactory {
    ReportRequest reportRequest();
    ExpenseRequest expenseRequest();
    EmployeeRequest employeeRequest();
}

, . . EntryPoint GWT.create(...):

final ApplicationRequestFactory requestFactory = 
    GWT.create(ApplicationRequestFactory.class);
requestFactory.init(eventBus);

com.springsource.extrack.gwt.request ApplicationEntityTypesProcessor.java, generics . - .

, :

  • EmployeeRecord.java - DTO .
  • EmployeeRecordChanged.java - RecordChanged, hook onEmployeeChanged.
  • EmployeeChangedHandler.java - , , onEmployeeChanged.
  • EmployeeRequest.java - , ApplicationRequestFactory .

, . M1 M2 , GWT. , , , M1-M2.

, , . ReportListActivity.java:

public void start(Display display) {
    this.registration = eventBus.addHandler(ReportRecordChanged.TYPE, new ReportChangedHandler() {
        public void onReportChanged(ReportRecordChanged event) {
            update(event.getWriteOperation(), event.getRecord());
        }
    });
    super.start(display);
}

. , cost.roo , "", . GWTing.

.

+7

, , (, , Google , ;)), API , , GWT 2.1 ( GWT Google IO 2010). , Bikeshed sample , (,;)) . 2.1 branch, , , (?) ( , Google IO).
, RPC, , GWT, , ;) ( - , : D).

0

Source: https://habr.com/ru/post/1755357/


All Articles