[jboss-cvs] jboss-seam/src/main/org/jboss/seam/core ...
Gavin King
gavin.king at jboss.com
Sun Jul 8 07:23:08 EDT 2007
User: gavin
Date: 07/07/08 07:23:08
Modified: src/main/org/jboss/seam/core ResourceBundle.java
Log:
don't blow up when getting messages outside contexts
Revision Changes Path
1.33 +7 -1 jboss-seam/src/main/org/jboss/seam/core/ResourceBundle.java
(In the diff below, changes in quantity of whitespace are not shown.)
Index: ResourceBundle.java
===================================================================
RCS file: /cvsroot/jboss/jboss-seam/src/main/org/jboss/seam/core/ResourceBundle.java,v
retrieving revision 1.32
retrieving revision 1.33
diff -u -b -r1.32 -r1.33
--- ResourceBundle.java 20 Jun 2007 17:45:55 -0000 1.32
+++ ResourceBundle.java 8 Jul 2007 11:23:08 -0000 1.33
@@ -17,6 +17,7 @@
import org.jboss.seam.annotations.Scope;
import org.jboss.seam.annotations.Unwrap;
import org.jboss.seam.annotations.intercept.BypassInterceptors;
+import org.jboss.seam.contexts.Contexts;
import org.jboss.seam.log.LogProvider;
import org.jboss.seam.log.Logging;
import org.jboss.seam.navigation.Pages;
@@ -24,7 +25,7 @@
import org.jboss.seam.util.Strings;
/**
- * Support for an application-global resource bundle
+ * A session-scoped localized resource bundle
*
* @author Gavin King
*/
@@ -206,6 +207,11 @@
public static java.util.ResourceBundle instance()
{
+ if ( !Contexts.isSessionContextActive() )
+ {
+ throw new IllegalStateException("no session context active");
+ }
return (java.util.ResourceBundle) Component.getInstance(ResourceBundle.class, true);
}
+
}
More information about the jboss-cvs-commits
mailing list