当前位置: 首页>>代码示例>>Java>>正文


Java ModuleConfig.findActionConfig方法代码示例

本文整理汇总了Java中org.apache.struts.config.ModuleConfig.findActionConfig方法的典型用法代码示例。如果您正苦于以下问题:Java ModuleConfig.findActionConfig方法的具体用法?Java ModuleConfig.findActionConfig怎么用?Java ModuleConfig.findActionConfig使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在org.apache.struts.config.ModuleConfig的用法示例。


在下文中一共展示了ModuleConfig.findActionConfig方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: obtenerActionForm

import org.apache.struts.config.ModuleConfig; //导入方法依赖的package包/类
protected ActionForm obtenerActionForm(ActionMapping mapping, HttpServletRequest request, String path) {
    ModuleConfig config = mapping.getModuleConfig();
    ActionMapping newMapping = (ActionMapping) config.findActionConfig(path);
    ActionForm newForm = RequestUtils.createActionForm(request, newMapping, config, this.servlet);
    if ("session".equals(newMapping.getScope())) {
        request.getSession(true).setAttribute(newMapping.getAttribute(), newForm);
    } else {
        request.setAttribute(newMapping.getAttribute(), newForm);
    }
    newForm.reset(newMapping, request);
    return newForm;
}
 
开发者ID:GovernIB,项目名称:sistra,代码行数:13,代码来源:BaseAction.java

示例2: obtenerActionForm

import org.apache.struts.config.ModuleConfig; //导入方法依赖的package包/类
protected ActionForm obtenerActionForm(ActionMapping mapping, HttpServletRequest request, String path) 
{
    ModuleConfig config = mapping.getModuleConfig();
    ActionMapping newMapping = (ActionMapping) config.findActionConfig(path);
    ActionForm newForm = RequestUtils.createActionForm(request, newMapping, config, this.servlet);
    if ("session".equals(newMapping.getScope())) {
        request.getSession(true).setAttribute(newMapping.getAttribute(), newForm);
    } else {
        request.setAttribute(newMapping.getAttribute(), newForm);
    }
    newForm.reset(newMapping, request);
    return newForm;
}
 
开发者ID:GovernIB,项目名称:sistra,代码行数:14,代码来源:BaseAction.java

示例3: obtenerActionForm

import org.apache.struts.config.ModuleConfig; //导入方法依赖的package包/类
/** Retorna el ActionForm asociado al action en el path especificado */
protected ActionForm obtenerActionForm(ActionMapping mapping, HttpServletRequest request, String path) {
    ModuleConfig config = mapping.getModuleConfig();
    ActionMapping newMapping = (ActionMapping) config.findActionConfig(path);
    ActionForm newForm = RequestUtils.createActionForm(request, newMapping, config, this.servlet);
    if ("session".equals(newMapping.getScope())) {
        request.getSession(true).setAttribute(newMapping.getAttribute(), newForm);
    } else {
        request.setAttribute(newMapping.getAttribute(), newForm);
    }
    newForm.reset(newMapping, request);
    return newForm;
}
 
开发者ID:GovernIB,项目名称:sistra,代码行数:14,代码来源:BaseAction.java

示例4: execute

import org.apache.struts.config.ModuleConfig; //导入方法依赖的package包/类
/**
 * <p>Cache the <code>ActionConfig</code> instance for the action to be
 * used for processing this request.</p>
 *
 * @param actionCtx The <code>Context</code> for the current request
 * @return <code>false</code> so that processing continues
 * @throws InvalidPathException if no valid action can be identified for
 *                              this request
 * @throws Exception            if thrown by the Action class
 */
public boolean execute(ActionContext actionCtx)
    throws Exception {
    // Identify the matching path for this request
    String path = getPath(actionCtx);

    // Cache the corresponding ActonConfig instance
    ModuleConfig moduleConfig = actionCtx.getModuleConfig();
    ActionConfig actionConfig = moduleConfig.findActionConfig(path);

    if (actionConfig == null) {
        // NOTE Shouldn't this be the responsibility of ModuleConfig?
        // Locate the mapping for unknown paths (if any)
        ActionConfig[] configs = moduleConfig.findActionConfigs();

        for (int i = 0; i < configs.length; i++) {
            if (configs[i].getUnknown()) {
                actionConfig = configs[i];

                break;
            }
        }
    }

    if (actionConfig == null) {
        throw new InvalidPathException("No action config found for the specified url.",
            path);
    }

    actionCtx.setActionConfig(actionConfig);

    return (false);
}
 
开发者ID:SonarSource,项目名称:sonar-scanner-maven,代码行数:43,代码来源:AbstractSelectAction.java

示例5: execute

import org.apache.struts.config.ModuleConfig; //导入方法依赖的package包/类
public ActionForward execute(ActionMapping       mapping,
                             ActionForm          form,
                             HttpServletRequest  request,
                             HttpServletResponse response) throws Exception {
    
    InstanciaDelegate delegate = RegistroManager.recuperarInstancia(request);
    if (delegate == null) {
        ActionErrors errors = new ActionErrors();
        errors.add(null, new ActionError("errors.session"));
        saveErrors(request, errors);
        return mapping.findForward("fail");
    }

    Pantalla p = delegate.obtenerPantalla();
    if (p == null) {
    	
    	// En caso de ser telematico comprobamos si debemos ir a la penultima pantalla o bien devolver el control
    	boolean telematic = (delegate instanceof InstanciaTelematicaDelegate);
    	if (telematic) {
            InstanciaTelematicaDelegate itd = (InstanciaTelematicaDelegate) delegate;
            Map propiedadesForm = itd.obtenerPropiedadesFormulario();
            boolean mostrarPantallaFin = false;
        	try{
        		mostrarPantallaFin = (propiedadesForm.get("pantallaFin.mostrar")!=null?Boolean.parseBoolean((String)propiedadesForm.get("pantallaFin.mostrar")):false);
        	}catch (Exception ex){
        		log.error("La propiedad pantallaFin.mostrar no tiene un valor v�lido (true/false): " + propiedadesForm.get("pantallaFin.mostrar"));
        		mostrarPantallaFin = false;
        	}
        	if (!mostrarPantallaFin){
        		response.sendRedirect("finalitzarTelematic.do?ID_INSTANCIA=" + (String) request.getAttribute(RegistroManager.ID_INSTANCIA));
        		return null;
        	}
        }
    	
    	// Vamos a penultima pantalla
        return mapping.findForward("end");
        
    } else {
        ModuleConfig config = mapping.getModuleConfig();
        ActionMapping nextMapping = (ActionMapping) config.findActionConfig("/procesar");
        PantallaForm pantallaForm = (PantallaForm) RequestUtils.createActionForm(request, nextMapping, config, getServlet());
        request.setAttribute(nextMapping.getAttribute(), pantallaForm);
        pantallaForm.reset(nextMapping, request);
        // Alimentamos con datos pantalla actual
    	BeanUtils.populate(pantallaForm, delegate.obtenerDatosPantalla());
        return mapping.findForward("view");
    }
}
 
开发者ID:GovernIB,项目名称:sistra,代码行数:49,代码来源:VerAction.java


注:本文中的org.apache.struts.config.ModuleConfig.findActionConfig方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。