jsp中如何保存信息,使得服务器重新启动后可以读取

gaosl11 2003-08-18 04:19:21
谢谢
...全文
42 2 打赏 收藏 转发到动态 举报
写回复
用AI写文章
2 条回复
切换为时间正序
请发表友善的回复…
发表回复
gaosl11 2003-08-21
  • 打赏
  • 举报
回复
不好意思,忘了说明了,不能保存在文件里,最好是保存在类似于注册表的地方
stonewang 2003-08-18
  • 打赏
  • 举报
回复
在服务器写一个文件,方法:
public static void testWrite(String str,String fileName)
{
FileOutputStream out;
try {
out = new FileOutputStream(fileName);
byte[] b = str.getBytes();
out.write(b);
}
catch (Exception e) {
e.printStackTrace();
}
}

81,092

社区成员

发帖
与我相关
我的任务
社区描述
Java Web 开发
社区管理员
  • Web 开发社区
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

试试用AI创作助手写篇文章吧