[daisy] Daisy 1.5M2 error.xsl
Bruno Dumon
bruno at outerthought.org
Mon Jul 17 14:09:11 CDT 2006
On Mon, 2006-07-17 at 14:30 -0400, Mindaugas Idzelis wrote:
>
> I think error.xsl should have this instead: (doesn't work when
> checking [1] element of the throwable)
>
> <xsl:when test="exceptionChain/throwable[@class =
> 'org.outerj.daisy.repository.DocumentReadDeniedException'] and
> $httpMethod = 'GET'">
> <xsl:value-of select="exceptionChain/throwable[@class =
> 'org.outerj.daisy.repository.DocumentReadDeniedException']/@message"/>
Good catch, this must have been in there for a while already. This check
stopped working with a certain Cocoon release, from which all our own
exceptions were wrapped inside another exception.
I've changed the check simply to use index [2]. If
DocumentReadDeniedExceptions are nested deeper, it must be for some
other cause that we probably want to display to the user.
>
> I also added this little bit of javascript as the last part of the
> first <xsl:when> to automatically take you back to login page:
>
> <xsl:variable name="location">
> <xsl:value-of
> select="concat($mountPoint,'/login?returnTo=')"/>
> <xsl:value-of select="urlencoder:encode($pageURI,
> 'UTF-8')"/>
> </xsl:variable>
> <script language="javascript"> window.location='<xsl:value-of
> select="$location"/>';</script>
For default, I prefer to keep the current behaviour, as it tells the
user explicitely what is wrong.
--
Bruno Dumon http://outerthought.org/
Outerthought - Open Source, Java & XML Competence Support Center
bruno at outerthought.org bruno at apache.org
More information about the daisy
mailing list