[ http://jira.andromda.org/browse/BPM-245?page=comments#action_11964 ] Bobby Peterson commented on BPM-245: ------------------------------------
I couldn't try yesterday, but I did try this morning, and I still get the same results. It continues on the the next JSP. The generated code has changed a little, but I don't see how this code should prevent it from going on to the next state in the flow. I definitely don't see how the next method is prevented from being called. I am not throwing an exception, just calling saveErrorMessage. Should that change? sorry I can't attach the project, we have 21 models and a few thousands files. In the code below and in the model, we want to call saveDetails then if we had no errors during the save we want to go on to the next step and retrieveData for display to the user. Currently when we have errors it still tries to retrieveData (causing problems) and shows the error from the save on that new page. This can be reproduced throughout our application. Thanks again. New Generated code: private org.apache.struts.action.ActionForward _detailsOk(org.apache.struts.action.ActionMapping mapping, org.apache.struts.action.ActionForm form, javax.servlet.http.HttpServletRequest request, javax.servlet.http.HttpServletResponse response) throws java.lang.Exception { org.apache.struts.action.ActionForward forward = null; com.sys.uswdss.web.planning.plan.PlanControllerFactory.getPlanControllerInstance().saveDetails(mapping, (DetailsSummarySaveDetailsFormImpl)form, request, response); forward = _retrieveData(mapping, form, request, response); return forward; } > saveErrorMessages don't work anymore > ------------------------------------ > > Key: BPM-245 > URL: http://jira.andromda.org/browse/BPM-245 > Project: Bpm4Struts Cartridge > Type: Bug > Versions: 3.1M1 > Environment: JDK 1.5, Struts 1.2.7, Windows XP Pro > Reporter: Bobby Peterson > Assignee: Wouter Zoons > Priority: Critical > > After upgrading to 3.1 I have had many problems with the error messages and > validation. The custom validation is still not working. In the controller > methods I call saveErrorMessage given it the request and a valid message key. > The error is saved into the session but the flow of the application > continues to go to the next action state, JSP which causes major problems > because an error has occured. > With some investigation I found that the code generated in 3.0 wrapped the > next call in an if block like the following: > if (this.errorsNotPresent(request)) > { > forward = _retrieveData(mapping, form, request, response); > } > in 3.1 the code looks like: > forward = _retrieveData(mapping, form, request, response); > Is there a reason this change was made? Did I not set a property? If so, > shouldn't the old behavior be the default? > Thanks for the help or the fix. > The complete methods are below: > ############################################### 3.0 > ########################################### > ActionForward forward = null; > private ActionForward _detailsOk(ActionMapping mapping, ActionForm form, > HttpServletRequest request, HttpServletResponse response) throws Exception > { > ActionForward forward = null; > final org.apache.struts.action.ActionMessages errors = > this.getExceptionHandlerErrors(request); > try > { > if (this.errorsNotPresent(request)) > { > > PlanControllerFactory.getPlanControllerInstance().saveDetails(mapping, > DetailsSummarySaveDetailsFormImpl)form, request, response); > } > if (this.errorsNotPresent(request)) > { > forward = _retrieveData(mapping, form, request, response); > } > } > catch (Exception ex) > { > final String messageKey = > org.andromda.presentation.bpm4struts.PatternMatchingExceptionHandler.instance().handleException(ex); > > errors.add(org.apache.struts.action.ActionMessages.GLOBAL_MESSAGE, new > org.apache.struts.action.ActionMessage(messageKey)); > } > finally > { > } > if (!errors.isEmpty()) > { > forward = mapping.getInputForward(); > } > return forward; > } > ###################################### 3.1 > ######################################################### > private org.apache.struts.action.ActionForward > _detailsOk(org.apache.struts.action.ActionMapping mapping, > org.apache.struts.action.ActionForm form, > javax.servlet.http.HttpServletRequest request, > javax.servlet.http.HttpServletResponse response) throws java.lang.Exception > { > org.apache.struts.action.ActionForward forward = null; > try > { > > com.sys.uswdss.web.planning.plan.PlanControllerFactory.getPlanControllerInstance().saveDetails(mapping, > (DetailsSummarySaveDetailsFormImpl)form, request, response); > forward = _retrieveData(mapping, form, request, response); > } > catch (java.lang.Exception exception) > { > final java.lang.String messageKey = > org.andromda.presentation.bpm4struts.PatternMatchingExceptionHandler.instance().handleException(exception); > > com.sys.uswdss.web.planning.plan.PlanControllerFactory.getPlanControllerInstance().saveErrorMessage(request, > messageKey); > throw exception; > } > return forward; > } -- This message is automatically generated by JIRA. - If you think it was sent incorrectly contact one of the administrators: http://jira.andromda.org/secure/Administrators.jspa - If you want more information on JIRA, or have a bug to report see: http://www.atlassian.com/software/jira ------------------------------------------------------- SF.Net email is Sponsored by the Better Software Conference & EXPO September 19-22, 2005 * San Francisco, CA * Development Lifecycle Practices Agile & Plan-Driven Development * Managing Projects & Teams * Testing & QA Security * Process Improvement & Measurement * http://www.sqe.com/bsce5sf _______________________________________________ Andromda-devel mailing list Andromda-devel@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/andromda-devel