0
我正在做我的第一個Java網站,其中war/MyWeb.html中的表單由MyWeb.java管理。我想要的是,在提交表單後,會加載一個新的網頁MyWeb2.html。我怎樣才能做到這一點?我有一個評論,我覺得這個代碼應該去...感謝MyWeb.html的用Java提交表單後加載新頁面
PIECE
<table align="center">
<tr>
<td id="fileChooserContainer" align="left"></td>
</tr>
<tr>
<td id="submitButtonContainer" align="right"></td>
</tr>
</table>
MyWeb.java這塊
public void onModuleLoad() {
final Button submitButton = new Button("Submit");
final FileUpload chooser = new FileUpload();
RootPanel.get("submitButtonContainer").add(compressButton);
RootPanel.get("fileChooserContainer").add(chooser);
class EncoderHandler implements ClickHandler, KeyUpHandler {
public void onClick(ClickEvent event) {
loadNewPage();
}
private void loadNewPage() {
// What do I have to code here to open a MyWeb2.html???
}
}
EncoderHandler handler = new EncoderHandler();
submitButton.addClickHandler(handler);
}