You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@struts.apache.org by bu...@apache.org on 2004/05/07 19:44:08 UTC

DO NOT REPLY [Bug 28817] - ClassCastException in org.apache.struts.taglib.TagUtils.java

DO NOT REPLY TO THIS EMAIL, BUT PLEASE POST YOUR BUG 
RELATED COMMENTS THROUGH THE WEB INTERFACE AVAILABLE AT
<http://issues.apache.org/bugzilla/show_bug.cgi?id=28817>.
ANY REPLY MADE TO THIS MESSAGE WILL NOT BE COLLECTED AND 
INSERTED IN THE BUG DATABASE.

http://issues.apache.org/bugzilla/show_bug.cgi?id=28817

ClassCastException in org.apache.struts.taglib.TagUtils.java





------- Additional Comments From rickkw@yahoo.com  2004-05-07 17:44 -------
Hi, I have tested the following patch which works around the problem.  However,
I think it is best to fix the source of the problem of not putting Struts
library object into the HttpRequest since a request may span across web
applications.  Please consider the following patch.  Thanks so much! 

--
Rick

------------------------
--- TagUtils.java.orig	Thu May  6 05:37:47 2004
+++ TagUtils.java	Thu May  6 17:49:47 2004
@@ -1208,18 +1208,22 @@
         }
 
         if (resources == null) {
+            try {
             resources =
                     (MessageResources) pageContext.getAttribute(
                             bundle,
                             PageContext.REQUEST_SCOPE);
+            } catch (ClassCastException e) {}
         }
 
         if (resources == null) {
+            try {
             ModuleConfig moduleConfig = getModuleConfig(pageContext);
             resources =
                     (MessageResources) pageContext.getAttribute(
                             bundle + moduleConfig.getPrefix(),
                             PageContext.APPLICATION_SCOPE);
+            } catch (ClassCastException e) {}
         }
         
         if (resources == null) {

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@struts.apache.org
For additional commands, e-mail: dev-help@struts.apache.org