本文整理汇总了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;
}
示例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;
}
示例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;
}
示例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);
}
示例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");
}
}