You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@sling.apache.org by "Phillpotts, James" <Ja...@experian.com> on 2012/07/25 11:30:58 UTC

Custom Error Page JSPs

Hi all,

I have written a few JSPs to handle errors - Throwable.jsp, 403.jsp and 404.jsp so far. All of these seem to suffer from a couple of issues:

1) JSP EL expressions do not work, so for example in Throwable.jsp ${javax.servlet.error.message} returns nothing, but <%= request.getAttribute("javax.servlet.error.message") %> correctly returns the message from the caught Throwable.

2) The ResourceBundle fetched from the SlingHttpServletRequest is a NullResourceBundle not a JcrResourceBundle, so we can't use our internationalization content from the repository.

Can someone tell me if these are bugs, or deliberate features?

Cheers,
James



Information in this e-mail and any attachments is confidential, and may not be copied or used by anyone other than the addressee, nor disclosed to any third party without our permission. There is no intention to create any legally binding contract or other binding commitment through the use of this electronic communication unless it is issued in accordance with the Experian Limited standard terms and conditions of purchase or other express written agreement between Experian Limited and the recipient. Although Experian has taken reasonable steps to ensure that this communication and any attachments are free from computer virus, you are advised to take your own steps to ensure that they are actually virus free. 

Companies Act information: Registered name: Experian Limited. Registered office: Landmark House, Experian Way, NG2 Business Park, Nottingham, NG80 1ZZ, United Kingdom. Place of registration: England and Wales. Registered number: 653331


RE: Custom Error Page JSPs

Posted by "Phillpotts, James" <Ja...@experian.com>.
Hi again,

I've resolved the second of these issues - when browsing the source I discovered that both the I18NHttpServletRequest and the I18NSlingHttpServletRequest will return the JcrResourceBundle when you call getAttribute(ResourceBundleProvider.BUNDLE_REQ_ATTR).

I still see the other issue with the JSP EL expressions, though. Any ideas?

Cheers,
James

-----Original Message-----
From: Phillpotts, James
Sent: 25 July 2012 10:31
To: users@sling.apache.org
Subject: Custom Error Page JSPs

Hi all,

I have written a few JSPs to handle errors - Throwable.jsp, 403.jsp and 404jsp so far. All of these seem to suffer from a couple of issues:

1) JSP EL expressions do not work, so for example in Throwable.jsp ${javax.servlet.error.message} returns nothing, but <%= request.getAttribute("javax.servlet.error.message") %> correctly returns the message from the caught Throwable.

2) The ResourceBundle fetched from the SlingHttpServletRequest is a NullResourceBundle not a JcrResourceBundle, so we can't use our internationalization content from the repository.

Can someone tell me if these are bugs, or deliberate features?

Cheers,
James



Information in this e-mail and any attachments is confidential, and may not be copied or used by anyone other than the addressee, nor disclosed to any third party without our permission. There is no intention to create any legally binding contract or other binding commitment through the use of this electronic communication unless it is issued in accordance with the Experian Limited standard terms and conditions of purchase or other express written agreement between Experian Limited and the recipient. Although Experian has taken reasonable steps to ensure that this communication and any attachments are free from computer virus, you are advised to take your own steps to ensure that they are actually virus free.

Companies Act information: Registered name: Experian Limited. Registered office: Landmark House, Experian Way, NG2 Business Park, Nottingham, NG80 1ZZ, United Kingdom. Place of registration: England and Wales. Registered number: 653331


Re: Custom Error Page JSPs

Posted by Bertrand Delacretaz <bd...@apache.org>.
Hi James,

On Wed, Jul 25, 2012 at 11:30 AM, Phillpotts, James
<Ja...@experian.com> wrote:
> I have written a few JSPs to handle errors - Throwable.jsp, 403.jsp and 404.jsp so far...
>
> 1) JSP EL expressions do not work, so for example in Throwable.jsp ${javax.servlet.error.message} returns nothing, but <%= request.getAttribute("javax.servlet.error.message") %> correctly returns the message from the caught Throwable.

I don't know enough about that part of the code to answer, best might
be to create a JIRA issue about it - if it's by design it's at least
something that needs to be documented.

-Bertrand