📄 parametersactionfactoryproxy.java
字号:
/* * WebWork, Web Application Framework * * Distributable under Apache license. * See terms of license at opensource.org */package webwork.action.factory;import webwork.action.*;import webwork.util.BeanUtil;import java.util.Map;/** * Sets properties on an action from parameters after locating it through * the action factory proxy chain. * * @author Rickard 謆erg (rickard@middleware-company.com) * @version $Revision: 1.10 $ */public class ParametersActionFactoryProxy extends ActionFactoryProxy{ // Attributes ---------------------------------------------------- // Constructors -------------------------------------------------- public ParametersActionFactoryProxy(ActionFactory aFactory) { super(aFactory); } // ActionFactory implementation ------------------------------- /** * Sets properties on the obtained action from the parameters. * If an IllegalArgumentException is thrown, a ResultException * will be thrown with "error" as the result. This means that if * a view is mapped to "error" then the user will be returned * and the field causing the error will be highlighted. * * @see BeanUtil#setProperties(Map, Object) */ public Action getActionImpl(String aName) throws Exception { // Get action from factory Action action = getNextFactory().getActionImpl(aName); // Check if the NoParameters interface is implemented. In that // case no parameters should be set so we just return the action if (action instanceof NoParameters) return action; // Set parameters try { BeanUtil.setProperties(ActionContext.getParameters(), action); } catch (IllegalArgumentException e) { throw new ResultException(Action.ERROR); } // Return action return action; }}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -