0
我在GWT中的StockPriceService示例中掙扎。我已經設法讓它運行,並且執行了步驟2(http://www.gwtproject.org/doc/latest/tutorial/RPC.html),在那裏我實現了StockPriceServerImpl類。(GWT教程)StockPriceServiceImpl :: getPrices()被調用5次
public class StockPriceServiceImpl extends RemoteServiceServlet implements StockPriceService {
它的工作原理,也就是被稱爲OK,但這裏的問題:
我宣佈在班上就像一個變量:
private ConfigurationLoader confLoader = null;
,然後在getPrices()方法:
if (confLoader == null) {
System.out.println("----creating a conf loader instance ---");
confLoader = new ConfigurationLoader("192.168.2.199","8888");
}
的問題,當我運行它是:
消息「----創建conf加載器...」被打印5(五)次....然後它顯然運行OK ...?
任何想法發生了什麼?