Bug 53465 - mapped-name is read when in @Resource, but not when in web.xml
Summary: mapped-name is read when in @Resource, but not when in web.xml
Alias: None
Product: Tomcat 7
Classification: Unclassified
Component: Catalina (show other bugs)
Version: 7.0.28
Hardware: PC All
: P2 normal (vote)
Target Milestone: ---
Assignee: Tomcat Developers Mailing List
Depends on:
Reported: 2012-06-25 20:31 UTC by Violeta Georgieva
Modified: 2012-06-26 22:04 UTC (History)
0 users

Patch proposal (2.20 KB, patch)
2012-06-25 20:31 UTC, Violeta Georgieva
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Violeta Georgieva 2012-06-25 20:31:48 UTC
Created attachment 28995 [details]
Patch proposal


When I have the code below in a servlet

	private DataSource ds;

'mapped name' is read when @Resource is processed (org.apache.catalina.startup.WebAnnotationSet.addResource(WebAnnotationSet.java:377)) so later on it is available through Reference object as StringRefAddr

But when I have the declaration below in web.xml


'mapped name' is not read at all.

I would like to propose a patch that adds additional Rule to WebRuleSet so that 'mapped name' is process and set as property.

I'm looking forward to your comments.

Violeta Georgieva
Comment 1 Mark Thomas 2012-06-26 22:04:50 UTC
Thanks for the proposed patch. I extended it to cover all resource types and applied it trunk and 7.0.x. It will be included in 7.0.29 onwards.