openfire 插件--readme.html页面乱码解决

来源:互联网 发布:python自动化运维工具 编辑:程序博客网 时间:2024/05/24 04:22

3.9及以下版本会有readme.html页面乱码问题,修改plugin-admin.jsp

<% if (showReadme) {
    String pluginName = ParamUtils.getParameter(request, "plugin");
    Plugin plugin = pluginManager.getPlugin(pluginName);
    StringBuilder readmeString = new StringBuilder();
    if (plugin != null) {
        File readme = new File(pluginManager.getPluginDirectory(plugin), "readme.html");
        if (readme.exists()) {
            BufferedReader in = null;
            try {
                in = new BufferedReader(new InputStreamReader(new FileInputStream(readme), "UTF8"));
                String line;
                while ((line = in.readLine()) != null) {
                readmeString.append(line);
                readmeString.append(System.getProperty("line.separator"));
                    }
                }
                catch (IOException ioe) {
                    ioe.printStackTrace();
                }
                finally {
                    if (in != null) {
                        try {
                            in.close();
                        }
                        catch (Exception e) {
                        }
                    }
                }
            }
        }
%>

jsp编译后存放在 openfire\plugins\admin\webapp\WEB-INF\lib\admin-jsp.jar   下,部署时放对应文件夹即可。

0 0
原创粉丝点击