All Downloads are FREE. Search and download functionalities are using the official Maven repository.

com.opensymphony.xwork.interceptor.ModelDrivenInterceptor Maven / Gradle / Ivy

Go to download

XWork is an command-pattern framework that is used to power WebWork as well as other applications. XWork provides an Inversion of Control container, a powerful expression language, data type conversion, validation, and pluggable configuration.

There is a newer version: 2.0.3
Show newest version
/*
 * Copyright (c) 2002-2003 by OpenSymphony
 * All rights reserved.
 */
package com.opensymphony.xwork.interceptor;

import com.opensymphony.xwork.Action;
import com.opensymphony.xwork.ActionInvocation;
import com.opensymphony.xwork.ModelDriven;
import com.opensymphony.xwork.util.OgnlValueStack;


/**
 * Watches for ModelDriven Actions and adds the model from the Action on to the
 * value stack.
 * 

* Note: The ModelDrivenInterceptor must come before the both * {@link StaticParametersInterceptor} and {@link ParametersInterceptor} if you * want the parameters to be applied to the model. * * @author $Author: unkyaku $ * @version $Revision: 1.2 $ */ public class ModelDrivenInterceptor extends AroundInterceptor { //~ Methods //////////////////////////////////////////////////////////////// protected void after(ActionInvocation dispatcher, String result) throws Exception { } protected void before(ActionInvocation invocation) throws Exception { Action action = invocation.getAction(); if (action instanceof ModelDriven) { ModelDriven modelDriven = (ModelDriven) action; OgnlValueStack stack = invocation.getStack(); stack.push(modelDriven.getModel()); } } }





© 2015 - 2024 Weber Informatics LLC | Privacy Policy