当前位置: 技术问答>java相关
如何在用户登入后,以建立的session唯一号(如../mail.jsp?USERID=60029FB49A5BBCAD93CA40F523DB7D566F)进行操作??
来源: 互联网 发布时间:2015-02-23
本文导语: id号的编码如何做? | a Simple example public IDPruduce{ private int newID; private static IDPruduce instance=null; private IDPruduce{ //get a value to start newID=0;} //get the only one object of IDPruduce public synchronize...
id号的编码如何做?
|
a Simple example
public IDPruduce{
private int newID;
private static IDPruduce instance=null;
private IDPruduce{
//get a value to start
newID=0;}
//get the only one object of IDPruduce
public synchronized static IDPruduce getInstance(){
instance=new IDPruduce() ;
}
//get id
public synchronized int getNewID{
newID++;
return newID;
}
public IDPruduce{
private int newID;
private static IDPruduce instance=null;
private IDPruduce{
//get a value to start
newID=0;}
//get the only one object of IDPruduce
public synchronized static IDPruduce getInstance(){
instance=new IDPruduce() ;
}
//get id
public synchronized int getNewID{
newID++;
return newID;
}