我有一个使用GWT创建的web应用程序,它通过http请求与php文件进行交互。我做下面的PHP文件的请求: http://localhost/bibliotheek/php/addUser.php?username=username.test2&group=test&admin=false&password=&topadmin=falsehttp请求后GWT中未捕获的异常
当我这样做是托管模式(编译这么之后)我得到以下异常:
未捕获的异常:[异常... “ 'java.lang.NumberFormatException:对于 输入字符串: “”' 当调用方法: [nsIDOMEventListener ::的handleEvent] “ nsresult: ”0x8057001c (NS_ERROR_XPC_JS_THREW_JS_OBJECT)“ 位置:” JS帧:: 铬://萤火虫/内容/ spy.js :: callPageHandler ::行744" 的数据: 无]
线0
我得到这个例外,仅此要求,不与其他请求。我就与下面的代码请求:
protected void addUserToTheDatabase(String[] data) {
String file = "addUser.php?username=" + data[0] + "&group=" + data[1] + "&admin=" +
data[2] + "&password=" + data[3] + "&topadmin=" + data[4];
request object = new request();
object.getMessageXml(file, "GET", "null", new AsyncCallback<String>() {
@Override
public void onFailure(Throwable caught) {
new UserInterface.notification(BibPhp.error.INTERNET_CONNECTION);
caught.getMessage();
}
@Override
public void onSuccess(String result) {
if(Integer.parseInt(result) == 0) {
new UserInterface.notification("Deze gebruikersnaam is reeds in gebruik.");
}
else {
new UserInterface.notification("Gebruiker toegevoegd.");
}
new add(false);
}
});
}
我不知道我做错了,因为所有其他要求或确切一样的,只是到其他文件。 php文件不会生成响应,因此可以产生任何影响。
任何其他遇到此问题或有任何建议的人?
在此先感谢。
好的我会尝试 – 2011-04-15 20:34:42