Bug 53001 - Behaviour of ResourceBundleELResolver
Summary: Behaviour of ResourceBundleELResolver
Status: RESOLVED FIXED
Alias: None
Product: Tomcat 6
Classification: Unclassified
Component: Jasper (show other bugs)
Version: 6.0.35
Hardware: PC Linux
: P2 normal (vote)
Target Milestone: default
Assignee: Tomcat Developers Mailing List
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2012-03-29 09:41 UTC by b.diedrichsen
Modified: 2012-05-28 18:50 UTC (History)
0 users



Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description b.diedrichsen 2012-03-29 09:41:39 UTC
I have discovered the the ResourceBundleELResolver from the tomcat el-api.jar behaves differently then the one from standard el-api.

The difference lays in the handling of missing properties. The tomcat version will not set the resolved property to true such that evaluation continues and finally an exception is thrown. This causes pages to crash if a property can not be found (which I think is kind of unacceptable for production sites).

The bahaviour was changed due to https://issues.apache.org/bugzilla/show_bug.cgi?id=46915.

I think that changing the standard behaviour of "resolving" an unbound property by just returning its key is to throwing an exception was a strong decision. I would strongly recommend of reintroducing the old bahviour and fixing the issue 46915 in a different way. If someone can point my to the requirements and corner cases related to 46915, I will gladly provide an implementation.

Until then, a workaround for everybody using jsf: Subclass the ResourceBundleELResolver and override its getValue(...) method. Change it such that it sets the PropertyResolved attribute to true before any exception might occur. Register this custom resolver in the faces-config.xml with <el-resolver>
Comment 1 Mark Thomas 2012-03-30 09:37:02 UTC
Tomcat is no longer following the EL spec.

The behaviour prior to the fix for bug 46915 was correct.

I'm not sure it is possible to fix bug 46915 and be specification compliant.

I'll revert the fix for bug 46915, put together some test cases and see what I can come up with. Depending on how well things go, bug 46915 will either stay as FIXED or be changed to INVALID.
Comment 2 b.diedrichsen 2012-03-30 10:09:43 UTC
Thanks for the quick reply. I did not check the spec so wasn't aware that the current behaviour actually violates the el specs. Why was the fix for bug 46915 done in the first place? Did the specs change from then to now? Anyways, keep up the good work. Tomcat is an impressive and very reliable product.
Comment 3 Mark Thomas 2012-03-30 15:23:19 UTC
No change in the spec. I failed to check the EL spec before I fixed bug 46915. If I had, that would have been resolved as INVALID. It looks like EL 2.2 (Tomcat 7) has some new features that would allow the requirement in bug 46915 to be met. Time to write some unit tests.
Comment 4 Mark Thomas 2012-03-30 16:35:59 UTC
Fixed in trunk and 7.0.x and will be included in 7.0.27 onwards.

The fixed has been proposed for 6.0.x.
Comment 5 b.diedrichsen 2012-03-30 18:09:37 UTC
Thank you Mark,
this was really a quick resolution of the issue.
Comment 6 Konstantin Kolinko 2012-05-28 18:50:20 UTC
Fixed in 6.0 with r1343356 and will be in 6.0.36