Skip to content
This repository has been archived by the owner on Oct 29, 2019. It is now read-only.

Commit

Permalink
WL-322 WL-406 Error pages for 403 and 404
Browse files Browse the repository at this point in the history
WL-574 Don't generate a session for JSPs.
WL-323 Fix tool_base.css URL.
  • Loading branch information
buckett committed Aug 16, 2011
1 parent b3671e8 commit 66489e1
Show file tree
Hide file tree
Showing 3 changed files with 111 additions and 0 deletions.
31 changes: 31 additions & 0 deletions access-tool/tool/src/webapp/WEB-INF/web.xml
Original file line number Diff line number Diff line change
Expand Up @@ -52,5 +52,36 @@
/*
</url-pattern>
</servlet-mapping>

<!-- Mapping for error handlers (see below). -->
<servlet>
<servlet-name>handler403</servlet-name>
<jsp-file>/error403.jsp</jsp-file>
</servlet>

<servlet-mapping>
<servlet-name>handler403</servlet-name>
<url-pattern>/error403.jsp</url-pattern>
</servlet-mapping>

<servlet>
<servlet-name>handler404</servlet-name>
<jsp-file>/error404.jsp</jsp-file>
</servlet>

<servlet-mapping>
<servlet-name>handler404</servlet-name>
<url-pattern>/error404.jsp</url-pattern>
</servlet-mapping>

<error-page>
<error-code>403</error-code>
<location>/error403.jsp</location>
</error-page>

<error-page>
<error-code>404</error-code>
<location>/error404.jsp</location>
</error-page>

</web-app>
49 changes: 49 additions & 0 deletions access-tool/tool/src/webapp/error403.jsp
Original file line number Diff line number Diff line change
@@ -0,0 +1,49 @@
<%@ page import="org.sakaiproject.component.cover.ServerConfigurationService" %>
<%@ page session="false" %>
<html>
<head>

<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<meta http-equiv="Content-Style-Type" content="text/css">

<title>Access to the requested resource is forbidden - 403 Error</title>

<link href="<%= ServerConfigurationService.getString("skin.repo", "/library/skin") %>/tool_base.css" type="text/css" rel="stylesheet" media="all" />
<link href="<%= ServerConfigurationService.getString("skin.repo", "/library/skin") %>/<%= ServerConfigurationService.getString("skin.default", "default") %>/tool.css" type="text/css" rel="stylesheet" media="all" />

</head>
<body>
<h1>Access to the requested resource is forbidden</h1>

<p>You do not have permission to view the requested resource.</p>
<p>This could be for one of a number of reasons.</p>

<h2>Either, you need to login</h2>

<p>There are two ways to login to the system. Both links are found at the top of the page (on the right):</p>

<ul>
<li><em>Oxford Account</em> - this is for users who are registered with The University of Oxford. Clicking on this link will log you in to WebLearn via Oxford's single sign-on system. If you are currently not authenticated then you will be asked for your username and password, otherwise you will be presented with a confirmation page. Follow the instructions to gain access to WebLearn </li>
<li><em>Other Users</em> - this is for users who are <em>not</em> registered with The University of Oxford but who have a special account within WebLearn. Enter your WebLearn username and password at the prompt.</li>
</ul>

<h2>Or, you have not been given permission to access it</h2>

<p>You may need to contact the site owner and ask for access.</p>

<p>If you know which site the resource is a part of then click on the <em>Site Info</em> link in the Tools Menu on the left-hand side of the page. You should see the site owner's name and a corresponding email address; contact them and ask for access.</p>

<p>If you do not know which site the resource belongs to then ask the person who told you about the link.</p>

<h2>Or, the resource is not yet available or has become unavailable</h2>

<p>It is possible to restrict resources to only be available between certain dates, it may be that you are either too early or too late to see the resource.

<h2>Or, the address is incorrect</h2>

<p>Check your typing!</p>

<p> Have you been sent the wrong address? Perhaps you should confirm with the person that sent you the link that they havent made a mistake? </p>
</body>
</html>

31 changes: 31 additions & 0 deletions access-tool/tool/src/webapp/error404.jsp
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
<%@ page import="org.sakaiproject.component.cover.ServerConfigurationService" %>
<%@ page session="false" %>
<html>
<head>

<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<meta http-equiv="Content-Style-Type" content="text/css">

<title>The resource you have requested is unavailable 404 Error</title>

<link href="<%= ServerConfigurationService.getString("skin.repo", "/library/skin") %>/tool_base.css" type="text/css" rel="stylesheet" media="all" />
<link href="<%= ServerConfigurationService.getString("skin.repo", "/library/skin") %>/<%= ServerConfigurationService.getString("skin.default", "default") %>/tool.css" type="text/css" rel="stylesheet" media="all" />

</head>
<body>
<h1>The resource you have requested is unavailable</h1>

<p>The resource you requested could not be found.</p>

<p>You could try reloading the page as the error may be due to a problem with the network. If this does not work then it looks like there is a problem with the link which directs you to the resource. </p>

<p>Possible solutions:</p>

<ul>
<li>You should check your typing!</li>
<li>If the link was sent to you in an email then check that addess has not been split over two or more lines by your email client. You may have to reassemble the URL manually. You can do this easily by copying the text and pasting the various parts back together in the location bar of your browser.</li>
<li>Have you been sent the wrong address? Perhaps you should confirm with the person that sent you the link that they havent made a mistake? </li>
</ul>
</body>
</html>

0 comments on commit 66489e1

Please sign in to comment.