1 package org.apache.turbine.pipeline; 2 3 56 57 import java.io.IOException ; 58 import org.apache.turbine.TurbineConstants; 59 import org.apache.turbine.RunData; 60 import org.apache.turbine.TurbineException; 61 import org.apache.turbine.ValveContext; 62 import org.apache.commons.logging.Log; 63 import org.apache.commons.logging.LogFactory; 64 65 72 public class DetermineActionValve 73 extends AbstractValve 74 { 75 private static final Log log 76 = LogFactory.getLog( DetermineActionValve.class ); 77 78 81 public void invoke( RunData data, ValveContext context ) 82 throws IOException , TurbineException 83 { 84 if ( ! data.hasAction() ) 85 { 86 String action = 87 data.getParameters().getString( TurbineConstants.ACTION ); 88 89 if ( action != null ) 90 { 91 data.setAction( action ); 92 93 log.debug( "Set action from request parameter" ); 94 } 95 else 96 { 97 log.debug( "No action" ); 98 } 99 } 100 101 if ( log.isDebugEnabled() ) 102 { 103 log.debug( "Action is now: " + data.getAction() ); 104 } 105 106 context.invokeNext( data ); 108 } 109 } 110 | Popular Tags |