You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@beehive.apache.org by ek...@apache.org on 2006/03/19 02:40:33 UTC

svn commit: r386908 - /beehive/trunk/netui/src/tags-html/org/apache/beehive/netui/tags/divpanel/DivPanelCRI.java

Author: ekoneil
Date: Sat Mar 18 17:40:31 2006
New Revision: 386908

URL: http://svn.apache.org/viewcvs?rev=386908&view=rev
Log:
Fixup the DivPanelCRI to implement both the RequestInterceptor and Command APIs.  Once we've decided if trunk/ is a 1.x release or a 1.0.x release, we can remove the RequestInterceptor part of the implementation.

Need to switch the webapp configurations from using global interceptors to commands next.

BB: self
Test: NetUI BVT pass


Modified:
    beehive/trunk/netui/src/tags-html/org/apache/beehive/netui/tags/divpanel/DivPanelCRI.java

Modified: beehive/trunk/netui/src/tags-html/org/apache/beehive/netui/tags/divpanel/DivPanelCRI.java
URL: http://svn.apache.org/viewcvs/beehive/trunk/netui/src/tags-html/org/apache/beehive/netui/tags/divpanel/DivPanelCRI.java?rev=386908&r1=386907&r2=386908&view=diff
==============================================================================
--- beehive/trunk/netui/src/tags-html/org/apache/beehive/netui/tags/divpanel/DivPanelCRI.java (original)
+++ beehive/trunk/netui/src/tags-html/org/apache/beehive/netui/tags/divpanel/DivPanelCRI.java Sat Mar 18 17:40:31 2006
@@ -42,8 +42,6 @@
         assert context instanceof WebChainContext;
         assert ((WebChainContext)context).getServletRequest() instanceof HttpServletRequest;
 
-        boolean handled = false;
-
         WebChainContext webChainContext = (WebChainContext)context;
         HttpServletRequest request = (HttpServletRequest)webChainContext.getServletRequest();
 
@@ -53,13 +51,7 @@
 
         String cmd = getCommand(uri, ctxtPath);
 
-        // check to see if we handle this command
-        if (SWITCH_PAGE.equals(cmd)) {
-            handlePageSwitch(request);
-            handled = true;
-        }
-
-        return handled;
+        return handleCommand(cmd, request);
     }
 
     public void preRequest(RequestInterceptorContext ctxt, InterceptorChain chain)
@@ -72,12 +64,20 @@
 
         String cmd = getCommand(uri, ctxtPath);
 
+        handleCommand(cmd, request);
+    }
+
+    public void postRequest(RequestInterceptorContext context, InterceptorChain chain) throws InterceptorException
+    {
+        chain.continueChain();
+    }
 
-        // check to see if we handle this command
-        if (SWITCH_PAGE.equals(cmd)) {
+    private boolean handleCommand(String command, HttpServletRequest request) {
+        if (SWITCH_PAGE.equals(command)) {
             handlePageSwitch(request);
+            return true;
         }
-
+        else return false;
     }
 
     private void handlePageSwitch(HttpServletRequest req)
@@ -102,10 +102,5 @@
 
         DivPanelState state = (DivPanelState) n;
         state.setFirstPage(fp);
-    }
-
-    public void postRequest(RequestInterceptorContext context, InterceptorChain chain) throws InterceptorException
-    {
-        chain.continueChain();
     }
 }