use of org.apache.struts.action.ActionMapping in project sonar-java by SonarSource.
the class ExceptionHandler method handle.
// ------------------------------------------------------- Protected Methods
protected ForwardConfig handle(ActionContext context, Exception exception, ExceptionConfig exceptionConfig, ActionConfig actionConfig, ModuleConfig moduleConfig) throws Exception {
// Look up the remaining properties needed for this handler
ServletActionContext sacontext = (ServletActionContext) context;
ActionForm actionForm = (ActionForm) sacontext.getActionForm();
HttpServletRequest request = sacontext.getRequest();
HttpServletResponse response = sacontext.getResponse();
// Handle this exception
org.apache.struts.action.ExceptionHandler handler = (org.apache.struts.action.ExceptionHandler) ClassUtils.getApplicationInstance(exceptionConfig.getHandler());
return (handler.execute(exception, exceptionConfig, (ActionMapping) actionConfig, actionForm, request, response));
}
use of org.apache.struts.action.ActionMapping in project sonar-java by SonarSource.
the class ValidateActionForm method validate.
// ------------------------------------------------------- Protected Methods
/**
* <p>Call the <code>validate()</code> method of the specified form bean,
* and return the resulting <code>ActionErrors</code> object.</p>
*
* @param context The context for this request
* @param actionForm The form bean for this request
*/
protected ActionErrors validate(ActionContext context, ActionConfig actionConfig, ActionForm actionForm) {
ServletActionContext saContext = (ServletActionContext) context;
ActionErrors errors = (actionForm.validate((ActionMapping) actionConfig, saContext.getRequest()));
// Special handling for multipart request
if ((errors != null) && !errors.isEmpty()) {
if (actionForm.getMultipartRequestHandler() != null) {
if (log.isTraceEnabled()) {
log.trace(" Rolling back multipart request");
}
actionForm.getMultipartRequestHandler().rollback();
}
}
return errors;
}
Aggregations