gwt 응용 프로그램에 module1과 module2라는 두 개의 모듈 이름을 만들었습니다. 몇 초 후에 module1에서 module2로, module2에서 module1로 메시지를 동시에 전달하고 싶습니다. 다음 코드를 작성했지만 classpath에 module1.gwt.xml을 찾을 수 없다는 오류가 발생합니다. 당신이 동일한 웹 페이지에 포함 (* 파일을 .nocache.js)이 개 분리 된 모듈을하려는 경우 당신이 JS를 사용하지 않는GWT에서 두 모듈을 통신하는 방법
public void onModuleLoad() {
mainBus.fireEvent(new PingEvent("-----Simulation Started-----"));
}
module1
public void onModuleLoad()
{
GWTEventBus.mainBus.addHandler(PingEvent.TYPE, new PingEventHandler(){
public void onEvent(PingEvent event) {
System.out.print("Inside Ping --> ");
new Timer(){
public void run() {
GWTEventBus.mainBus.fireEvent(new PongEvent("Pong fired..."));
}
}.schedule(1000);
}
});
}
module2
public void onModuleLoad()
{
//final SimpleEventBus mainBus = new SimpleEventBus();
GWTEventBus.mainBus.addHandler(PongEvent.TYPE, new PongEventHandler(){
public void onEvent(PongEvent event) {
System.out.print("Inside Pong1 --> ");
new Timer(){
public void run() {
GWTEventBus.mainBus.fireEvent(new PingEvent("Ping fired..."));
}
}.schedule(1000);
}
});
}
plz help me.
은'하나의 항목 point'을 가질 수 있습니다 앱은 완전히 사실이 아니다, 당신은 응용 프로그램에서 여러 엔트리 포인트를 가질 수있다. –
문서를 다시 살펴본 후에 여러 개의 진입 점을 실제로 사용할 수 있습니다. – aglassman
이 답변은 올바르지 않기 때문에 삭제해야합니다 ... – snorbi