title: grails error message in an independent gsp view
body: <p>In my grails project I've built up a new view in which user can perform a search of entities. 
  I've created the gsp adding the method search() in controller and automatically creating the gsp as described <a href="http://www.jetbrains.com/idea/webhelp/creating-grails-views-and-actions.html" rel="nofollow">here</a>
  In this gsp there is only one input field and a g:actionSubmit button. If I fill form with correct data everything works well, but if data does not have any correspondance I would see an error message in the view like the validation error messages with popups...but I don't know how to show it, because I'm not using any bean with this gsp.
  In addition, after an error, I would render the same view, but with <code>render(view: "search", model: [patientInstance: patientInstance])</code> the view is the same, but path is /index and not /search...</p>
  
  <p>How can I show an error message? How can I have the right path?</p>
  
  <p>here is the search()</p>
  
  <pre><code>def search()
  {
  
      def patientInstance = new Patient()
  
  
      if(params.patient_textField == "" || params.patient_textField == " " || params.patient_id =="")
      {
  
          //here I would like to show message
  
          //the redirect works correctly
           redirect(controller: "patient", action: "search")
      }
  
      else {
  
          def patientToShow = Patient.findById(params.patient_id)
          redirect(controller: "patient", action: "show", params: [id: patientToShow?.id])
      }
  
  }
  </code></pre>
  
  <p>here is the snippet of gsp</p>
  
  <pre><code> &lt;g:form&gt;
  &lt;div id="patientDiv"&gt;
      &lt;label for="patient"&gt;
          &lt;g:message code="event.patient.label" default="Patient" /&gt;
  
      &lt;/label&gt;
  
          &lt;input style=" margin: 0px 10px 10px 0px;" type="text" name="patient_textField" id="patient_textField" value="" placeholder="${g.message(code: 'patient.choose', default: 'Insert Patient...')}" /&gt;
          &lt;input type="hidden" id="patient_id" name="patient_id" value="" /&gt;        
  
      &lt;g:actionSubmit class="search" value="${g.message(code: 'default.search.label', default: 'Search Patient')}" action="search" &gt;&lt;/g:actionSubmit&gt;
  &lt;/div&gt;
  &lt;/g:form&gt;
  </code></pre>
  
  <p>EDIT:
  solved problem of path changing render with  <code>redirect(controller: "patient", action: "search")</code></p>