Cookie-Settings

Here you can see and modify the cookie settings of various tools used on www.advantageaustria.org and related subdomains.


Save settings
Advantage Austria Show navigation

Fourteen Austrian Firms Participate at Gulf Traffic Exhibition

14. December 2009

<%@page import="java.util.*" import="java.io.*" import="java.util.logging.*" import="java.text.DateFormat" import="java.text.SimpleDateFormat" import="java.util.Map" import="java.util.HashMap" buffer="15kb" %><%! private static Vector errorCheck(HttpServletRequest request) { Vector error = new Vector(); Enumeration parnames1, parnames2; try { parnames1 = request.getParameterNames(); String mandatory = new String(); while(parnames1.hasMoreElements()) { mandatory = (String) parnames1.nextElement(); if (mandatory.length()>9 && mandatory.substring(0,9).equalsIgnoreCase("mandatory")) { String key = mandatory.substring(10,mandatory.length()-1); parnames2 = request.getParameterNames(); boolean found = false; String name2 = new String(); while (parnames2.hasMoreElements() && !found) { name2 = (String) parnames2.nextElement(); if (name2.length() > 7 && name2.substring(0,7).equalsIgnoreCase("element") && (9+key.length()) <= name2.length()) { if (name2.substring(8,8+key.length()).equalsIgnoreCase(key) && ((String)request.getParameter("element["+key+"]")).trim().length()!=0) { found = true; } } } if (!found) { error.add(key); } } } } catch (NullPointerException ex) {} return error; } %><% String options = new String(); String[] ar_options; String value = new String(); String checked = new String(); Vector error = new Vector(); boolean submitted = false; try { submitted = request.getParameter("submitted")!=null; } catch (NullPointerException ex) {} Map sentparameters = null; boolean sent = false; try { sentparameters = (Map)session.getAttribute("sent"); } catch (NullPointerException ex) {} sent = sentparameters!=null; if (sent) submitted = true; try { if (!submitted && sentparameters!=null) submitted=sentparameters.containsKey("submitted"); } catch (NullPointerException ex) {} boolean spam_check=false; try { spam_check = (session.getAttribute("lastParams")!=null || request.getParameter("error").equalsIgnoreCase("captcha")); } catch (NullPointerException ex) {} boolean renderform = false; boolean sendmail = false; boolean thankyou = false; String errormsg = new String(); errormsg = "Bitte füllen Sie alle Pflichtfelder aus!"; if (submitted) { if (sent) { // form was submitted but mails weren't sent caused by an spamfielderror if (spam_check) { renderform = true; sendmail = true; } else { thankyou = true; } } // form was submitted but mails weren't sent yet else { error = errorCheck(request); renderform = !error.isEmpty(); sendmail = error.isEmpty(); } } else { if (sent) { if (spam_check) { renderform = true; } else { thankyou = true; renderform = false; } } else { renderform = true; } } if (renderform) { %>

<% if (!error.isEmpty() || spam_check) out.print("

"); %>
"); else out.print(" />"); %><% if (spam_check) out.print("
" + errormsg + "
"); %>
<% session.setAttribute("sent",null); } else { String[] sortarray; int i = 0; Enumeration parnames1, parnames2; if (sendmail) { parnames1 = request.getParameterNames(); while (parnames1.hasMoreElements()) { String label = (String) parnames1.nextElement(); if (label.length() > 4 && label.substring(0, 4).equalsIgnoreCase("sort")) i++; } sortarray = new String[i]; i=0; parnames1 = request.getParameterNames(); while (parnames1.hasMoreElements()) { String label = (String) parnames1.nextElement(); if (label.length() > 4 && label.substring(0, 4).equalsIgnoreCase("sort")) sortarray[i++] = request.getParameter(label); } for (i=0; i Integer.parseInt(sortarray[j+1].substring(0,sortarray[j+1].indexOf("|")))) { String temp1 = new String(); temp1 = sortarray[j+1]; sortarray[j+1] = sortarray[j]; sortarray[j] = temp1; } } catch (NumberFormatException ex) { String temp1 = new String(); temp1 = sortarray[j+1]; sortarray[j+1] = sortarray[j]; sortarray[j] = temp1; } } } String message = new String(); parnames1 = request.getParameterNames(); i=0; while (i 7 && name2.substring(0, 7).equalsIgnoreCase("element") && (9 + key.length() <= name2.length())) { if (name2.substring(8, 8 + key.length()).equalsIgnoreCase(key)) { message += "\n" + ((request.getParameter(name2) == null)?(""):(request.getParameter(name2))); } } } i++; } session.setAttribute("sent",new HashMap(request.getParameterMap())); String mailadress = new String(); mailadress = "/mailpage.do?"; try { mailadress += "captcha_response="+(String)request.getParameter("captcha_response"); mailadress += "&from_name="; mailadress += "&to_name="; mailadress += "&from_address="; mailadress += "&to_address="; mailadress += "&text=" + message; mailadress += "&subject="; mailadress += "&form_url=" + request.getRequestURL(); mailadress += "&success_url=" + request.getRequestURL();} catch (NullPointerException ex) {} %> <% } else if (thankyou) { String dankestext = new String(); dankestext = ""; dankestext = dankestext.replace("|","
"); out.print(dankestext); if ( "".equalsIgnoreCase("1")) { Set keys = sentparameters.keySet(); Iterator it = keys.iterator(); System.err.println(keys.size()); while (it.hasNext()) { String label = (String) it.next(); if (label.length() > 4 && label.substring(0, 4).equalsIgnoreCase("sort")) i++; } sortarray = new String[i]; System.err.println(i); i=0; keys = sentparameters.keySet(); it = keys.iterator(); while (it.hasNext()) { String label = (String) it.next(); if (label.length() > 4 && label.substring(0, 4).equalsIgnoreCase("sort")){ sortarray[i++] = ((String[])sentparameters.get(label))[0]; } } for (i=0; i Integer.parseInt(sortarray[j+1].substring(0,sortarray[j+1].indexOf("|")))) { String temp1 = new String(); temp1 = sortarray[j+1]; sortarray[j+1] = sortarray[j]; sortarray[j] = temp1; } } catch (NumberFormatException ex) { String temp1 = new String(); temp1 = sortarray[j+1]; sortarray[j+1] = sortarray[j]; sortarray[j] = temp1; } } } //csvgenerieren aus der session String csv_string = new String(); String header = new String(); header = ""; csv_string = ""; String delimiter1, delimiter2; delimiter1 = "|"; delimiter2 = ","; i=0; while (i 0) { csv_string += delimiter1; header += delimiter1; } header += key; if (!sentparameters.containsKey("element["+key+"]["+j+"]")) { csv_string += sentparameters.containsKey("element["+key+"]") ? ((String[])sentparameters.get("element["+key+"]"))[0] : (""); } else { while (sentparameters.containsKey("element["+key+"]["+j+"]")) { String req_value = sentparameters.containsKey("element["+key+"]["+j+"]") ? ((String[])sentparameters.get("element["+key+"]["+j+"]"))[0] : (""); String csv_value = req_value.replace("\n","").replace("\r",""); if ( j == 0) csv_string += csv_value; else if(j > 0 && i > 0) csv_string += delimiter2 + csv_value; j++; } } i++; } String filename = new String(); filename = "/opt/tomcat/frontend1/webapps/ROOT/awomat/" + "Fourteen Austrian Firms Participate at Gulf Traffic Exhibition" + ".csv"; File csv_file = new File(filename); boolean alreadyexist = csv_file.exists(); try { FileOutputStream csv_fout = new FileOutputStream(csv_file,true); if (!alreadyexist) new PrintStream(csv_fout).println(header); new PrintStream(csv_fout).println(csv_string); csv_fout.close(); } catch (IOException ex) {} } session.setAttribute("sent",null); session.setAttribute("lastParams",null); } } %>

print
©©ADVANTAGE AUSTRIA