You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@struts.apache.org by ni...@apache.org on 2005/09/16 15:38:42 UTC

svn commit: r289535 - /struts/taglib/trunk/src/java/org/apache/struts/taglib/bean/MessageTag.java

Author: niallp
Date: Fri Sep 16 06:38:33 2005
New Revision: 289535

URL: http://svn.apache.org/viewcvs?rev=289535&view=rev
Log:
Change error message to show the actual Locale rather than the key for the locale in the Session when a message is not found.

Modified:
    struts/taglib/trunk/src/java/org/apache/struts/taglib/bean/MessageTag.java

Modified: struts/taglib/trunk/src/java/org/apache/struts/taglib/bean/MessageTag.java
URL: http://svn.apache.org/viewcvs/struts/taglib/trunk/src/java/org/apache/struts/taglib/bean/MessageTag.java?rev=289535&r1=289534&r2=289535&view=diff
==============================================================================
--- struts/taglib/trunk/src/java/org/apache/struts/taglib/bean/MessageTag.java (original)
+++ struts/taglib/trunk/src/java/org/apache/struts/taglib/bean/MessageTag.java Fri Sep 16 06:38:33 2005
@@ -1,7 +1,7 @@
 /*
  * $Id$ 
  *
- * Copyright 1999-2004 The Apache Software Foundation.
+ * Copyright 1999-2005 The Apache Software Foundation.
  * 
  * Licensed under the Apache License, Version 2.0 (the "License");
  * you may not use this file except in compliance with the License.
@@ -18,6 +18,7 @@
 
 package org.apache.struts.taglib.bean;
 
+import java.util.Locale;
 import javax.servlet.jsp.JspException;
 import javax.servlet.jsp.tagext.TagSupport;
 
@@ -222,12 +223,15 @@
                 args);
                 
         if (message == null) {
+            Locale locale = TagUtils.getInstance().
+                         getUserLocale(pageContext, this.localeKey);
+            String localeVal = (locale == null) ? "default locale" : locale.toString();
             JspException e =
                 new JspException(
                     messages.getMessage(
                     		"message.message", "\"" + key + "\"", 
                     		"\"" + (bundle == null ? "(default bundle)" : bundle) + "\"", 
-                    		localeKey));
+                    		localeVal));
             TagUtils.getInstance().saveException(pageContext, e);
             throw e;
         }



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