title: Grails retrieve controller parameters in g:each
body: <p>I am attempting to pass the result of validation failure from a form to a new view, where the fields which failed validation will be displayed. My code keeps displaying an error message instead of the validationResult, which does appear in the url parameters.</p>
  
  <p>The method which checks the validation is as follows:</p>
  
  <pre><code>def confirmFormToSave() {
      def ticket = Ticket.get(params.ticketId)
      def ticketId = params.ticketId as long
      ValidationResult validationResult = ticketService.validateCurrentTicketForms("", ticketId)
      if (!ticketValidationResult.isPassed()) {
        log.error "Validation failure, cannot change Ticket status"
        redirect(action: 'validateForm', params: [id: params.ticketId, validationResult: validationResult])
        return
      } else {
        params.isGroup = false
        redirect(action: 'submitForm', params: params)
      }
    }
  </code></pre>
  
  <p>This redirects on validation failure to the following method which renders the gsp:</p>
  
  <pre><code>def validateForm() {
      def ticket = Ticket.get(params.ticketId)
      def ticketId = params.ticketId as long
      ValidationResult validationResult = ticketService.validateCurrentTicketForms("", ticketId)
      def message = 'Sorry, we could not change the ticket state, validation has failed, please fill out all required fields.'
        [ticket: ticket, message: message, validationResult: validationResult]
    }
  </code></pre>
  
  <p>My  to pull this back in the gsp is as follows:</p>
  
  <pre><code>&lt;g:each in="${validationResult}" var="resultError"&gt;
     &lt;li&gt;${resultError}&lt;/li&gt;
  &lt;/g:each&gt;
  </code></pre>
  
  <p>I am unsure if I am passing the parameters between the two methods properly, because at the moment I am essentially checking for the same result twice in order to render this in validateForm.gsp, which doesn't seem right.</p>