フレームやGWTフレームワークを使用せずに、GWTに同等のjQueryのload()があるのだろうか。
GWTを使用してdivにファイル.htmlをロードする必要があります。
このようなもの: RootPanel.get("content").add(page.html);
何か案が?
フレームやGWTフレームワークを使用せずに、GWTに同等のjQueryのload()があるのだろうか。
GWTを使用してdivにファイル.htmlをロードする必要があります。
このようなもの: RootPanel.get("content").add(page.html);
何か案が?
これを追加<inherits name="com.google.gwt.http.HTTP" />
してください: gwt.xml ファイルに
HTML
次に、ウィジェットと RequestBuilder で何かを行うことができます
例えば
import com.google.gwt.http.client.*;
...
HTML htmlWidget = null;
String url = "http://www.myserver.com/getData?type=3";
RequestBuilder builder = new RequestBuilder(RequestBuilder.GET, URL.encode(url));
try {
Request request = builder.sendRequest(null, new RequestCallback() {
public void onError(Request request, Throwable exception) {
}
public void onResponseReceived(Request request, Response response) {
if (200 == response.getStatusCode()) {
htmlWidget = new HTML(response.getText());
} else {
// Handle the error. Can get the status text from response.getStatusText()
}
}
});
} catch (RequestException e) {
// Couldn't connect to server
}
if(htmlWidget!=null){
RootPanel.get("content").add(htmlWidget);
}
コンパイルできるかどうかわかりませんでした (現時点では IDE にアクセスできません)。
GWT アプリで HTML を外部化する最良の方法は?
あなたのシナリオでは、html リソースを含むクライアント バンドルをお勧めします。