tdawson 01/10/15 20:58:07
Modified: i18n/src/org/apache/taglibs/i18n ResourceHelper.java
Log:
Fixed a caching problem when more than one warfile using this taglib ends up
being processed during the same request (changed the ResourceHelper cache scope
from request to page which stays within the bounds of a single warfile).
Submitted by: Stephen Drye
Revision Changes Path
1.2 +7 -10
jakarta-taglibs/i18n/src/org/apache/taglibs/i18n/ResourceHelper.java
Index: ResourceHelper.java
===================================================================
RCS file:
/home/cvs/jakarta-taglibs/i18n/src/org/apache/taglibs/i18n/ResourceHelper.java,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -r1.1 -r1.2
--- ResourceHelper.java 2001/03/31 16:08:48 1.1
+++ ResourceHelper.java 2001/10/16 03:58:07 1.2
@@ -1,7 +1,7 @@
/*
- * $Header:
/home/cvs/jakarta-taglibs/i18n/src/org/apache/taglibs/i18n/ResourceHelper.java,v 1.1
2001/03/31 16:08:48 glenn Exp $
- * $Revision: 1.1 $
- * $Date: 2001/03/31 16:08:48 $
+ * $Header:
/home/cvs/jakarta-taglibs/i18n/src/org/apache/taglibs/i18n/ResourceHelper.java,v 1.2
2001/10/16 03:58:07 tdawson Exp $
+ * $Revision: 1.2 $
+ * $Date: 2001/10/16 03:58:07 $
*
* ====================================================================
*
@@ -87,15 +87,14 @@
"org.apache.taglibs.i18n.ResourceHelper.Bundle";
/**
- * Retrieves the bundle cached in the request by a previous call to
+ * Retrieves the bundle cached in the page by a previous call to
* getBundle(PageContext,String). This is used by the MessageTag since
* the bundle name is provided once, by the BundleTag.
* @return java.util.ResourceBundle the cached bundle
*/
static public ResourceBundle getBundle(PageContext pageContext)
{
- ServletRequest request = pageContext.getRequest();
- return (ResourceBundle)request.getAttribute(BUNDLE_REQUEST_KEY);
+ return (ResourceBundle)pageContext.getAttribute(BUNDLE_REQUEST_KEY);
}
/**
@@ -104,10 +103,8 @@
static public void setBundle(PageContext pageContext,
ResourceBundle bundle)
{
- ServletRequest request = pageContext.getRequest();
-
- // put this in the request so that the getMessage tag can get it quickly
- request.setAttribute(BUNDLE_REQUEST_KEY,bundle);
+ // put this in the page so that the getMessage tag can get it quickly
+ pageContext.setAttribute(BUNDLE_REQUEST_KEY,bundle);
}