首页 诗词 字典 板报 句子 名言 友答 励志 学校 网站地图
当前位置: 首页 > 教程频道 > 网站开发 > Web前端 >

无限极菜单之全自动化配备平台(待优化中.请等待消息)

2012-11-13 
无限极菜单之全自动化配置平台(待优化中..请等待消息)关键字:无限极菜单之全自动化配置平台使用方法: 应用

无限极菜单之全自动化配置平台(待优化中..请等待消息)

关键字:无限极菜单之全自动化配置平台

使用方法: 应用服务器启动时自动加载该方法,目的是生成menus.txt及menus.bat文件。
每次更改菜单时将tempMenus.properties文件内容复制到menus.txt文件中然后双击menus.bat文件,自动生成  menus.properties国际化文件,该文件可以直接使用(实现了国际化)。

注意:初始化写入的菜单文件起名为:tempMenus.properties

public void createGuoJiHuaFile(){
  String thePath = System.getProperty("user.dir");
 
  try {
  String guoJiHuaCmd  = "native2ascii.exe";
  String cmdFileName = "menus.bat";
  String txtFileName = "menus.txt";
  String baseFilePath = thePath+"\\src\";
  PrintWriter txtPw = new PrintWriter(new FileWriter(new File(baseFilePath + txtFileName),true));//不需要每次创建文件,只向文件写入数据
PrintWriter batPw = new PrintWriter(new FileWriter(new File(baseFilePath + cmdFileName),true));//不需要每次创建文件,只向文件写入数据
batPw.println(guoJiHuaCmd+" "+txtFileName+" "+"menus.properties");
batPw.close();
txtPw.close();
} catch (IOException e) {
e.printStackTrace();
}
  }

热点排行