【发布时间】:2011-05-09 11:33:48
【问题描述】:
我正在尝试在 glassfish 网络服务的应用范围中存储一个数字
网络服务:
@WebService()
public class datacheck {
//TODO 080 disable sql_log in the settings of hibernate
//TODO 090 check todo's from webservice_1
private int counter = 5;
当我请求计数器变量时,我得到 5 和
@WebMethod(operationName = "increaseCounter")
public Integer increaseCounter() {
counter++;
return counter;
}
返回 6 但 当我之后尝试这样做时,我再次得到 5:
@WebMethod(operationName = "getCounter")
public Integer getCounter() {
return counter;
}
如何存储可用于 web 服务中所有方法的变量?
【问题讨论】:
标签: java web-services variables scope glassfish-3