[Building Sakai] custom 403 and 404 pages

Adam Marshall adam.marshall at oucs.ox.ac.uk
Thu Aug 5 08:29:55 PDT 2010


we have this working in production.

apparently there was a tricky bit trying to get the pages to work inside the access servlet.

I guess this is something that would be good to have in 2.8?

adam

From: sakai-dev-bounces at collab.sakaiproject.org [mailto:sakai-dev-bounces at collab.sakaiproject.org] On Behalf Of mizematr at notes.udayton.edu
Sent: 05 August 2010 16:06
To: Nicola Monat-Jacobs
Cc: sakai-dev-bounces at collab.sakaiproject.org; John Ansorge; sakai-dev List
Subject: Re: [Building Sakai] custom 403 and 404 pages


I did this a while back thanks to this thread: http://tinyurl.com/d9f5en
---------------------------------------------------------------------------
Matt Mize, Systems Administrator
- Pay no attention to the man in the back office....
Matt.Mize at notes.udayton.edu
(937) 229-1024

UDit Department, University of Dayton
300 College Park, Dayton, OH, 45469-1302


<http://tinyurl.com/d9f5en>
[cid:_1_18A033F418A030200052E86585257776]

[Building Sakai] custom 403 and 404 pages


Nicola Monat-Jacobs

to:

sakai-dev List

08/04/10 11:52 AM


Sent by:

sakai-dev-bounces at collab.sakaiproject.org

Cc:

John Ansorge




________________________________



I did a little bit of googling and wasn't able to find anything, so I thought I'd post to the list.

We'd like to implement custom 403 and 404 pages in a Sakai 2.6 instance to make the user experience a little bit better. Tomcat allows you to specify these custom pages in the main web.xml, however, it appears that if you configure this, you don't capture all the 403 and 404 possibilities.

The following url will bring up the custom 404 page:
https://sakai.longsight.com/blarg<https://sakai.ohsu.edu/blarg%29>

But these urls will default to the standard 404 page:
https://<https://sakai.longsight.com/access/blarg>sakai.longsight.com<https://sakai.ohsu.edu/blarg%29>/access/blarg
https://<https://sakai.ohsu.edu/library/blarg%29.>sakai.longsight.com<https://sakai.ohsu.edu/blarg%29>/library/blarg

To quote from John Ansorge of OHSU who has also been working on the issue:

The Sakai tools are looking for the 404 and 403 pages within their own
webapp contexts. So, if you've configured conf/web.xml like this:

404
/404.htm

Then /library/ will look for the file in /webapps/library/404.htm. I
put the 404.htm file in /webapps/library/404.htm on our test server and
it worked.

However, if you visit
/access/blarg, it will look for the error page in Sakai's resources. I
tweaked the /webapps/access/WEB-INF/web.xml like so,

404
/content/public/error404.htm

restarted, and uploaded an "error404.htm" page into the public folder in
the admin panel, and the error404.htm page showed when I went to
/access/blarg in my browser.

I looked, but didn't find any way to configure the parameter
in web.xml to use the absolute root of the host instead of the webapp
root. That makes customizing the 404 and 403 messages kinda ugly,
really, since it would mean strewing 404.htm files in each and every
tool.

Anyone have any recommendations on how to address this? Otherwise, I'll make a feature request JIRA that this be a configurable setting.

Thanks,
Nicola_______________________________________________
sakai-dev mailing list
sakai-dev at collab.sakaiproject.org
http://collab.sakaiproject.org/mailman/listinfo/sakai-dev

TO UNSUBSCRIBE: send email to sakai-dev-unsubscribe at collab.sakaiproject.org with a subject of "unsubscribe"<http://collab.sakaiproject.org/mailman/listinfo/sakai-dev>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://collab.sakaiproject.org/pipermail/sakai-dev/attachments/20100805/26358a6c/attachment.html 
-------------- next part --------------
A non-text attachment was scrubbed...
Name: WL-406.patch
Type: application/octet-stream
Size: 5913 bytes
Desc: WL-406.patch
Url : http://collab.sakaiproject.org/pipermail/sakai-dev/attachments/20100805/26358a6c/attachment.obj 


More information about the sakai-dev mailing list