%@ page contentType="text/html; charset=UTF-8" pageEncoding="UTF-8" %> <%@taglib prefix="page" uri="http://www.opensymphony.com/sitemesh/page" %> <%@ taglib uri="http://www.opensymphony.com/sitemesh/decorator" prefix="decorator" %> <%@ page import="at.gv.egiz.pdfas.web.helper.LocalRequestHelper" %> <%@ page import="java.net.URL" %> <%@ page import="java.net.URLConnection" %> <%@ page import="java.io.InputStream" %> <%@ page import="java.io.InputStreamReader" %> <%@ page import="java.io.BufferedReader" %> <%@ page import="net.htmlparser.jericho.Source" %> <%@ page import="net.htmlparser.jericho.Element" %> <%@ page import="net.htmlparser.jericho.Attributes" %> <%@ page import="net.htmlparser.jericho.Attribute" %> <%@ page import="java.util.List" %> <%@ page import="java.util.Iterator" %> <%@ page import="java.util.Locale" %> <%@ page import="at.gv.egiz.pdfas.web.i18n.LocaleParamFilter" %> <%@ page import="java.nio.charset.Charset" %> <%@ page import="at.gv.egiz.pdfas.web.session.SessionAttributes" %> <%@page import="java.nio.charset.Charset"%>
<% String headerUrl="http://www.buergerkarte.at/header.php?lang="; //String headerUrl="http://www.buergerkarte.at/header.php"; String serverUrl=LocalRequestHelper.getLocalServerAddress(request,response); String baseUrl=LocalRequestHelper.getLocalContextAddress(request,response); /*if (serverUrl.contains("http")) { serverUrl.replace("http","https"); baseUrl.replace("http","https"); }*/ String requestLang = (String)request.getParameter("lang"); String language = ""; URL urlHeader = new URL(headerUrl); if (requestLang!=null) { if (requestLang.equals("de")) { urlHeader = new URL(headerUrl+"de"); language="de"; } else { urlHeader = new URL(headerUrl+"en"); language="en"; } } else { urlHeader = new URL(headerUrl+"de"); language="de"; } URLConnection ucHeader = urlHeader.openConnection(); InputStream isHeader = ucHeader.getInputStream(); //Read the header php files from the server BufferedReader brHeader = new BufferedReader(new InputStreamReader(isHeader, Charset.forName("UTF-8"))); String phpLine=""; String phpHeader=""; while ((phpLine=brHeader.readLine())!=null) { phpHeader += phpLine; } phpHeader = phpHeader.substring(phpHeader.indexOf("Sie sind hier: Startseite > PDF-Signatur > PDF-Signatur \n"; } else { replaceString = " "; } phpHeader = phpHeader.replace(breadcrumbsDiv, replaceString); } //Insert a hidden language fake link, that is shown when the change of language is disabled int positionToInsertLangLink = 0; source = new Source(phpHeader); list = source.getAllElements("ul"); it = list.iterator(); while (it.hasNext()) { Element element = (Element)it.next(); positionToInsertLangLink = element.getEnd(); } String languagelink; if (!language.equals("de")) { languagelink = ""; languagelink += "