Send to the error page when hs.jsp is accessed directly instead of locking up the...
[java-idp.git] / webApplication / hs.jsp
1 <%
2 response.setHeader("Expires","19-Mar-1971 08:23:00 GMT");
3 response.setHeader("Cache-control","no-cache");
4 response.setHeader("Pragma","no-cache");
5 %>
6
7 <?xml version="1.0" encoding="UTF-8"?>
8 <!DOCTYPE html 
9 PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" 
10     "DTD/xhtml1-strict.dtd">
11     <%@ taglib uri="/WEB-INF/tlds/struts-logic.tld" prefix="logic" %>
12     <%@ taglib uri="/WEB-INF/tlds/struts-bean.tld" prefix="bean" %>
13
14     <jsp:useBean id="shire" scope="request" class="java.lang.String" />
15     <jsp:useBean id="target" scope="request" class="java.lang.String" />
16     <jsp:useBean id="assertion" scope="request" class="java.lang.String" />
17     <jsp:useBean id="hs_helpText" scope="application" class="java.lang.String"/>
18     <jsp:useBean id="hs_detailedHelpURL" scope="application" class="java.lang.String"/>
19         
20 <html xmlns="http://www.w3.org/1999/xhtml"" xml:lang="en" lang="en">
21 <head>
22     <link rel="stylesheet" type="text/css" href="main.css" />
23     <title>Shibboleth Handle Request Processed</title>
24 </head>
25
26 <body onLoad="document.forms[0].submit()">
27
28 <% 
29         if (request.getAttribute("shire") == null
30                 || request.getAttribute("shire").equals("")
31                 || request.getAttribute("target") == null
32                 || request.getAttribute("target").equals("")
33                 || request.getAttribute("assertion") == null
34                 || request.getAttribute("assertion").equals("")) 
35         {
36                 request.setAttribute("requestURL", request.getRequestURI()); 
37                 request.setAttribute("errorText", "This page cannot be accessed directly"); 
38         request.getRequestDispatcher("/hserror.jsp").forward(request, response);
39         }
40 %>
41
42 <h1>Shibboleth Handle Request Processed</h1>
43
44 <!-- <p><bean:write name="hs_helpText" /></p> -->
45
46 <script language="JavaScript">
47 <!--    
48 document.write("<p>You are automatically being redirected to the requested site. ");
49 document.write("If the browser appears to be hung up after 15-20 seconds, try reloading ");
50 document.write("the page before contacting the technical support staff in charge of the ");
51 document.write("desired resource or service you are trying to access.</p>");
52 document.write("<h2>Redirecting to requested site...</h2>");
53 // -->
54 </script>
55
56 <noscript>
57 <b>Note:</b> Since your browser does not support JavaScript, you must press the
58 Continue button once to proceed to the requested site.
59 </noscript>
60
61 <p align="center">
62 <form name="shib"  action="<bean:write name="shire"/>" method="POST">
63 <input type="hidden" name="TARGET" value="<bean:write name="target" />">
64 <input type="hidden" name="SAMLResponse" value="<bean:write name="assertion" />">
65 <noscript>
66 <input type="submit" value="Continue">
67 </noscript>
68 </form>
69 </p>
70 <!--
71 <p><a target="help" href="<bean:write name="hs_detailedHelpURL" />">Detailed information</a> explaining this process.</p>
72 -->
73
74 </body>
75 </html>