private Result retrieveFachinfo(String lang, Medication m) { if (m != null) { String content = m.getContent().replaceAll("<html>|</html>|<body>|</body>|<head>|</head>", ""); String[] titles = getSectionTitles(lang, m); String[] section_ids = m.getSectionIds().split(","); String name = m.getTitle(); String titles_html = "<ul style=\"list-style-type:none;\n\">"; for (int i = 0; i < titles.length; ++i) { if (i < section_ids.length) titles_html += "<li><a onclick=\"move_to_anchor('" + section_ids[i] + "')\">" + titles[i] + "</a></li>"; } titles_html += "</ul>"; // Text-based HTTP response, default encoding: utf-8 if (content != null) { return ok(index.render(content, titles_html, name)); } } return ok("Hasta la vista, baby! You just terminated me."); }