Author: rich
Date: Sun Feb 27 13:25:55 2005
New Revision: 155641

URL: http://svn.apache.org/viewcvs?view=rev&rev=155641
Log:
Fixes for:
    - http://issues.apache.org/jira/browse/BEEHIVE-244 : Global forward to an 
action with an outputFormBean does not write the outputFormBean info to the 
forward in the generated struts config file
    - http://issues.apache.org/jira/browse/BEEHIVE-369 : No-cache behavior is 
broken under Firefox

DRT/BVT: netui (WinXP)
BB: self (linux)


Modified:
    
incubator/beehive/trunk/netui/src/compiler/org/apache/beehive/netui/compiler/genmodel/GenForwardModel.java
    
incubator/beehive/trunk/netui/src/compiler/org/apache/beehive/netui/compiler/model/ForwardModel.java
    
incubator/beehive/trunk/netui/src/util/org/apache/beehive/netui/util/ServletUtils.java

Modified: 
incubator/beehive/trunk/netui/src/compiler/org/apache/beehive/netui/compiler/genmodel/GenForwardModel.java
URL: 
http://svn.apache.org/viewcvs/incubator/beehive/trunk/netui/src/compiler/org/apache/beehive/netui/compiler/genmodel/GenForwardModel.java?view=diff&r1=155640&r2=155641
==============================================================================
--- 
incubator/beehive/trunk/netui/src/compiler/org/apache/beehive/netui/compiler/genmodel/GenForwardModel.java
 (original)
+++ 
incubator/beehive/trunk/netui/src/compiler/org/apache/beehive/netui/compiler/genmodel/GenForwardModel.java
 Sun Feb 27 13:25:55 2005
@@ -45,20 +45,20 @@
         }
         
         //
-        // returnForm/returnFormType
+        // outputFormBean/outputFormBeanType
         //
-        DeclaredType returnFormType = CompilerUtils.getDeclaredType( 
annotation, OUTPUT_FORM_BEAN_TYPE_ATTR, true );
-        String returnFormMember = CompilerUtils.getString( annotation, 
OUTPUT_FORM_BEAN_ATTR, true );
-        if ( returnFormMember != null )
+        DeclaredType outputFormType = CompilerUtils.getDeclaredType( 
annotation, OUTPUT_FORM_BEAN_TYPE_ATTR, true );
+        String outputFormMember = CompilerUtils.getString( annotation, 
OUTPUT_FORM_BEAN_ATTR, true );
+        if ( outputFormMember != null )
         {
-            FieldDeclaration field = CompilerUtils.getClassField( jclass, 
returnFormMember, null );
-            assert returnFormType == null;  // checker should catch this
+            FieldDeclaration field = CompilerUtils.getClassField( jclass, 
outputFormMember, null );
+            assert outputFormType == null;  // checker should catch this
             assert field != null;           // checker should catch this
             assert field.getType() instanceof DeclaredType : 
field.getType().getClass().getName(); // checker enforces
-            returnFormType = ( DeclaredType ) field.getType();
+            outputFormType = ( DeclaredType ) field.getType();
         }
-        setReturnFormMember( returnFormMember );
-        setReturnFormType( returnFormType != null ? 
CompilerUtils.getLoadableName( returnFormType ) : null );
+        setOutputFormBeanMember( outputFormMember );
+        setOutputFormBeanType( outputFormType != null ? 
CompilerUtils.getLoadableName( outputFormType ) : null );
         
         //
         // path, tilesDefinition, navigateTo, returnAction (mutually exclusive)

Modified: 
incubator/beehive/trunk/netui/src/compiler/org/apache/beehive/netui/compiler/model/ForwardModel.java
URL: 
http://svn.apache.org/viewcvs/incubator/beehive/trunk/netui/src/compiler/org/apache/beehive/netui/compiler/model/ForwardModel.java?view=diff&r1=155640&r2=155641
==============================================================================
--- 
incubator/beehive/trunk/netui/src/compiler/org/apache/beehive/netui/compiler/model/ForwardModel.java
 (original)
+++ 
incubator/beehive/trunk/netui/src/compiler/org/apache/beehive/netui/compiler/model/ForwardModel.java
 Sun Feb 27 13:25:55 2005
@@ -39,10 +39,10 @@
     private boolean _externalRedirect = false;
     private boolean _returnToPage = false;
     private boolean _returnToAction = false;
-    private String _returnFormType;
-    private String _returnFormMember;
+    private String _outputFormBeanType;
+    private String _outputFormBeanMember;
     private boolean _hasExplicitRedirectValue = false;
-    private List _actionOutputs = null;    // list of ActionOutputModel
+    private List< ActionOutputModel > _actionOutputs = null;
     private boolean _restoreQueryString = false;
     
 
@@ -108,11 +108,11 @@
             int n = _actionOutputs.size();
             SetProperty countProp = xb.addNewSetProperty();
             countProp.setProperty( "actionOutputCount" );
-            countProp.setValue( new Integer( n ).toString() );
+            countProp.setValue( Integer.toString( n ) );
             
             for ( int i = 0; i < n; ++i )
             {
-                ActionOutputModel pi = ( ActionOutputModel ) 
_actionOutputs.get( i );
+                ActionOutputModel pi = _actionOutputs.get( i );
                 SetProperty prop = xb.addNewSetProperty();
                 prop.setProperty( "actionOutput" + i );
                 prop.setValue( pi.getType() + '|' + pi.getNullable() + '|' + 
pi.getName() );
@@ -123,12 +123,9 @@
         // "nestedReturn" is set using set-property, which requires us to 
override the
         // ActionForward class.
         //
-        if ( _isNestedReturn )
-        {
-            addSetProperty( xb, "nestedReturn", "true" );
-            if ( _returnFormType != null ) addSetProperty( xb, 
"returnFormType", _returnFormType );
-            if ( _returnFormMember != null ) addSetProperty( xb, 
"returnFormMember", _returnFormMember );
-        }
+        if ( _isNestedReturn ) addSetProperty( xb, "nestedReturn", "true" );
+        if ( _outputFormBeanType != null ) addSetProperty( xb, 
"returnFormType", _outputFormBeanType );
+        if ( _outputFormBeanMember != null ) addSetProperty( xb, 
"returnFormMember", _outputFormBeanMember );
         
         addComment( xb );
     }    
@@ -158,24 +155,24 @@
         _isNestedReturn = nestedReturn;
     }
 
-    public String getReturnFormType()
+    public String getOutputFormBeanType()
     {
-        return _returnFormType;
+        return _outputFormBeanType;
     }
 
-    public void setReturnFormType( String returnFormType )
+    public void setOutputFormBeanType( String outputFormBeanType )
     {
-        _returnFormType = returnFormType;
+        _outputFormBeanType = outputFormBeanType;
     }
 
-    public String getReturnFormMember()
+    public String getOutputFormBeanMember()
     {
-        return _returnFormMember;
+        return _outputFormBeanMember;
     }
 
-    public void setReturnFormMember( String returnFormMember )
+    public void setOutputFormBeanMember( String outputFormBeanMember )
     {
-        _returnFormMember = returnFormMember;
+        _outputFormBeanMember = outputFormBeanMember;
     }
 
     public boolean getContextRelative()
@@ -269,7 +266,7 @@
         assert forwardsToPage() : "getPageName() called for non-page " + 
_path;  // NOI18N
 
         int slash = _path.lastIndexOf( '/' );  // NOI18N
-        return ( slash != -1 ? _path.substring( slash + 1 ) : _path );
+        return slash != -1 ? _path.substring( slash + 1 ) : _path;
     }
 
     public String getActionName()
@@ -283,25 +280,16 @@
 
     public void addActionOutput( ActionOutputModel actionOutput )
     {
-        if ( _actionOutputs == null )
-        {
-            _actionOutputs = new ArrayList();
-        }
-        
+        if ( _actionOutputs == null ) _actionOutputs = new ArrayList< 
ActionOutputModel >();
         _actionOutputs.add( actionOutput );
     }
     
-    public void setActionOutputs( List actionOutputs )
-    {
-        _actionOutputs = actionOutputs;
-    }
-
     public boolean isNestedReturn()
     {
         return _isNestedReturn;
     }
     
-    private void addSetProperty( Forward xb, String propertyName, String 
propertyValue )
+    private static void addSetProperty( Forward xb, String propertyName, 
String propertyValue )
     {
         SetProperty prop = xb.addNewSetProperty();
         prop.setProperty( propertyName );

Modified: 
incubator/beehive/trunk/netui/src/util/org/apache/beehive/netui/util/ServletUtils.java
URL: 
http://svn.apache.org/viewcvs/incubator/beehive/trunk/netui/src/util/org/apache/beehive/netui/util/ServletUtils.java?view=diff&r1=155640&r2=155641
==============================================================================
--- 
incubator/beehive/trunk/netui/src/util/org/apache/beehive/netui/util/ServletUtils.java
 (original)
+++ 
incubator/beehive/trunk/netui/src/util/org/apache/beehive/netui/util/ServletUtils.java
 Sun Feb 27 13:25:55 2005
@@ -112,8 +112,8 @@
         {
             HttpServletResponse httpResponse = ( HttpServletResponse ) 
response;
             httpResponse.setHeader( "Pragma", "No-cache" );
-            httpResponse.setDateHeader( "Expires", 0 );
-            httpResponse.setHeader( "Cache-Control", "no-cache" );
+            httpResponse.setHeader( "Cache-Control", 
"no-cache,no-store,max-age=0" );
+            httpResponse.setDateHeader( "Expires", 1 );
         }
     }
     


Reply via email to