[Building Sakai] custom 403 and 404 pages

Nicola Monat-Jacobs nicola at longsight.com
Wed Aug 4 08:51:59 PDT 2010


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

But these urls will default to the standard 404 page:
https://sakai.longsight.com/access/blarg
https://sakai.longsight.com/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
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://collab.sakaiproject.org/pipermail/sakai-dev/attachments/20100804/a4fff198/attachment.html 


More information about the sakai-dev mailing list