[jboss-cvs] jboss-seam/src/main/org/jboss/seam/core ...

Gavin King gavin.king at jboss.com
Sun Oct 8 20:10:30 EDT 2006


  User: gavin   
  Date: 06/10/08 20:10:30

  Modified:    src/main/org/jboss/seam/core   Pages.java
                        ResourceBundle.java
  Log:
  fixed JBSEAM-324, s:link and server restart / clustering
  fixed bug in resource bundle cascading
  
  Revision  Changes    Path
  1.29      +4 -15     jboss-seam/src/main/org/jboss/seam/core/Pages.java
  
  (In the diff below, changes in quantity of whitespace are not shown.)
  
  Index: Pages.java
  ===================================================================
  RCS file: /cvsroot/jboss/jboss-seam/src/main/org/jboss/seam/core/Pages.java,v
  retrieving revision 1.28
  retrieving revision 1.29
  diff -u -b -r1.28 -r1.29
  --- Pages.java	8 Oct 2006 23:12:24 -0000	1.28
  +++ Pages.java	9 Oct 2006 00:10:30 -0000	1.29
  @@ -282,13 +282,13 @@
         
         if (outcome==null)
         {
  -         String action = (String) facesContext.getExternalContext()
  +         String actionId = (String) facesContext.getExternalContext()
                  .getRequestParameterMap()
                  .get("actionMethod");
  -         if (action!=null)
  +         if (actionId!=null)
            {
  -            String expression = "#{" + action + "}";
  -            if ( !isActionAllowed(facesContext, expression) ) return result;
  +            if ( !SafeActions.instance().isActionSafe(actionId) ) return result;
  +            String expression = SafeActions.toAction(actionId);
               result = true;
               MethodBinding actionBinding = Expressions.instance().createMethodBinding(expression);
               outcome = toString( actionBinding.invoke() );
  @@ -301,17 +301,6 @@
         return result;
      }
   
  -   private static boolean isActionAllowed(FacesContext facesContext, String expression)
  -   {
  -      Map applicationMap = facesContext.getExternalContext().getApplicationMap();
  -      Set actions = (Set) applicationMap.get("org.jboss.seam.actions");
  -      if (actions==null) return false;
  -      synchronized (actions)
  -      {
  -         return actions.contains(expression);
  -      }
  -   }
  -   
      public String getNoConversationViewId(String viewId)
      {
         String result = getPage(viewId).noConversationViewId;
  
  
  
  1.11      +37 -28    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.10
  retrieving revision 1.11
  diff -u -b -r1.10 -r1.11
  --- ResourceBundle.java	8 Oct 2006 20:58:03 -0000	1.10
  +++ ResourceBundle.java	9 Oct 2006 00:10:30 -0000	1.11
  @@ -3,7 +3,9 @@
   import static org.jboss.seam.InterceptionType.NEVER;
   
   import java.io.Serializable;
  +import java.util.ArrayList;
   import java.util.Enumeration;
  +import java.util.List;
   import java.util.MissingResourceException;
   
   import org.apache.commons.logging.Log;
  @@ -62,22 +64,25 @@
      
      private void createUberBundle()
      {
  -      if ( bundleNames!=null && bundleNames.length>0 )
  +      if (bundleNames!=null)
         {
         
  -         final java.util.ResourceBundle[] littleBundles = new java.util.ResourceBundle[bundleNames.length];
  -         for (int i=0; i<bundleNames.length; i++)
  +         final List<java.util.ResourceBundle> littleBundles = new ArrayList<java.util.ResourceBundle>(bundleNames.length);
  +         for (String bundleName: bundleNames)
            {
  -            littleBundles[i] = loadBundle( bundleNames[i] );
  +            java.util.ResourceBundle littleBundle = loadBundle(bundleName);
  +            if (littleBundle!=null) littleBundles.add(littleBundle);
            }
            
  +         if ( !littleBundles.isEmpty() )
  +         {
            bundle = new java.util.ResourceBundle()
            {
      
               @Override
               public java.util.Locale getLocale()
               {
  -               return littleBundles[0].getLocale();
  +                  return Locale.instance();
               }
   
               @Override
  @@ -91,16 +96,20 @@
               {
                  for (java.util.ResourceBundle littleBundle: littleBundles)
                  {
  +                     if (littleBundle!=null)
  +                     {
                     try
                     {
                        return littleBundle.getObject(key);
                     }
                     catch (MissingResourceException mre) {}
                  }
  +                  }
                  throw new MissingResourceException("Can't find resource in bundles: " + key, getClass().getName(), key );
               }
               
            };
  +         }
            
         }
      }
  
  
  



More information about the jboss-cvs-commits mailing list