Updated HS form to xhtml 1.1. Fixed several validation problems.
[java-idp.git] / webApplication / hs.jsp
index 3405c52..50fa29f 100755 (executable)
@@ -1,13 +1,11 @@
-<%
-response.setHeader("Expires","19-Mar-1971 08:23:00 GMT");
-response.setHeader("Cache-control","no-cache");
-response.setHeader("Pragma","no-cache");
-%>
-
 <?xml version="1.0" encoding="UTF-8"?>
-<!DOCTYPE html 
-PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" 
-    "DTD/xhtml1-strict.dtd">
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN" "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
+    
+    <%
+               response.setHeader("Expires","19-Mar-1971 08:23:00 GMT");
+               response.setHeader("Cache-control","no-cache");
+               response.setHeader("Pragma","no-cache");
+       %>
     <%@ taglib uri="/WEB-INF/tlds/struts-logic.tld" prefix="logic" %>
     <%@ taglib uri="/WEB-INF/tlds/struts-bean.tld" prefix="bean" %>
 
@@ -17,20 +15,32 @@ PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
     <jsp:useBean id="hs_helpText" scope="application" class="java.lang.String"/>
     <jsp:useBean id="hs_detailedHelpURL" scope="application" class="java.lang.String"/>
        
-<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
+<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en">
 <head>
     <link rel="stylesheet" type="text/css" href="main.css" />
     <title>Shibboleth Handle Request Processed</title>
 </head>
 
-<body onLoad="document.forms[0].submit()">
+<body onload="document.forms[0].submit()">
 
-<h1>Shibboleth Handle Request Processed</h1>
+<% 
+       if (request.getAttribute("shire") == null
+               || request.getAttribute("shire").equals("")
+               || request.getAttribute("target") == null
+               || request.getAttribute("target").equals("")
+               || request.getAttribute("assertion") == null
+               || request.getAttribute("assertion").equals("")) 
+       {
+               request.setAttribute("requestURL", request.getRequestURI()); 
+               request.setAttribute("errorText", "This page cannot be accessed directly"); 
+        request.getRequestDispatcher("/hserror.jsp").forward(request, response);
+       }
+%>
 
-<!-- <p><bean:write name="hs_helpText" /></p> -->
+<h1>Shibboleth Handle Request Processed</h1>
 
-<script language="JavaScript">
-<!--
+<script type="text/javascript">
+<!--   
 document.write("<p>You are automatically being redirected to the requested site. ");
 document.write("If the browser appears to be hung up after 15-20 seconds, try reloading ");
 document.write("the page before contacting the technical support staff in charge of the ");
@@ -40,22 +50,24 @@ document.write("<h2>Redirecting to requested site...</h2>");
 </script>
 
 <noscript>
-<b>Note:</b> Since your browser does not support JavaScript, you must press the
+<p>
+<strong>Note:</strong> Since your browser does not support JavaScript, you must press the
 Continue button once to proceed to the requested site.
+</p>
 </noscript>
 
-<p align="center">
-<form name="shib"  action="<bean:write name="shire"/>" method="POST">
-<input type="hidden" name="TARGET" value="<bean:write name="target" />">
-<input type="hidden" name="SAMLResponse" value="<bean:write name="assertion" />">
+
+<form id="shibboleth"  action="<bean:write name="shire"/>" method="post">
+<div>
+<input type="hidden" name="TARGET" value="<bean:write name="target" />" />
+<input type="hidden" name="SAMLResponse" value="<bean:write name="assertion" />" />
+</div>
 <noscript>
-<input type="submit" value="Continue">
+<div>
+<input type="submit" value="Continue" />
+</div>
 </noscript>
-</form>
-</p>
-<!--
-<p><a target="help" href="<bean:write name="hs_detailedHelpURL" />">Detailed information</a> explaining this process.</p>
--->
 
+</form>
 </body>
 </html>