You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
public User getLoginInfo() {
User lu = new User();
lu.setUid(StringUtils.toInt(getProperty("user.uid"), 0));
lu.setName(getProperty("user.name"));
lu.setFace(getProperty("user.face"));
/* ohter code */
return lu;
}
在AppContext类中
/**
* 获取登录信息
* @return
*/
追踪getProperty()方法的定义,可以找到相关两个方法,如下:
不难发现,每次获取属性集中的某个属性,都要通过打开一次属性文件,读取props,即将所有属性都读出来。换句话说,如果要获取10个属性,这里就要打开10次属性文件,试问这样的IO效率是否他低了,有没有更好的解决办法?
The text was updated successfully, but these errors were encountered: