There is a possibly "tricky" solution: you can make redirect from cocoon stacktrace page.

i.e., you can add JS redirect if exception class matches ResourceNotFoundException
this can be done in exception page stylesheet ({$dspace_dir/webapps/xmlui/exception2html.xslt)

<xsl:if test="contains(@class, 'ResourceNotFoundException')">
             <script><xsl:text disable-output-escaping="yes"><![CDATA[ location.replace("NOT FOUND PAGE URL");]]></xsl:text></script>

Another way that I see is to restyle cocoon stacktrace page but this is too laborious way)

2013/2/8 helix84 <>
On Thu, Feb 7, 2013 at 6:02 PM, Thomas  Misilo <> wrote:
> I was wondering if anyone could point me in the right direction to maybe
> improving the 404 page for XMLUI?
> Currently it just throws a :org.apache.cocoon.ResourceNotFoundException:
> Page cannot be found
> Which isn’t very nice. I would like one similar to the one in JSPUI, where
> it keeps the them and updates the body with an error message such as Error:
> Document not found, or invalid identifier.

Hi Thomas,

XMLUI at once did display friendly errors, but those error pages were
sent with HTTP response code 200, not 404, which caused a lot of
problems, obviously. When this was changed, the friendly errors
functionality was lost for some reason.

See more here:

There might be some hard to solve problem there, but you're welcome to try.


Compulsory reading: DSpace Mailing List Etiquette

Free Next-Gen Firewall Hardware Offer
Buy your Sophos next-gen firewall before the end March 2013
and get the hardware for free! Learn more.
DSpace-tech mailing list
List Etiquette:

С уважением, Владимир Лебедев.