% response.setHeader("Content-Type", "text/html; charset=UTF-8");
String callingPage = (String)session.getAttribute("url");
if (session.getAttribute("conditions_accepted") == null)
// if_the attribute does not exist yet, create it depending on the passed parameter
try {
String testValue = session.getAttribute("usage.butAccept").toString();
String conditionsAccepted = request.getParameter("conditions");
// due to multilingual setup, the value of the accept-button may vary
// (set in the properties-files)
if (conditionsAccepted != null && conditionsAccepted.equals(testValue))
session.setAttribute("conditions_accepted", "true");
else {
response.sendRedirect(callingPage);
return;
}
}
catch (NullPointerException e) {
// the page has been called out of context - redirect to main entry page (BioCASE)
response.sendRedirect("http://ww2.biocase.org/abcdSimple/index.html");
return;
}
else
// evaluate the existing attribute (must be "true")
if (session.getAttribute("conditions_accepted") != "true") {
response.sendRedirect(callingPage);
return;
} %>