`
zhaoshijie
  • 浏览: 2243379 次
  • 性别: Icon_minigender_1
  • 来自: 北京
社区版块
存档分类
最新评论

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

    博客分类:
  • JS
阅读更多

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

使用方法: 应用服务器启动时自动加载该方法,目的是生成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();
}
  }
分享到:
评论

相关推荐

Global site tag (gtag.js) - Google Analytics