codeconsole opened a new pull request, #15560:
URL: https://github.com/apache/grails-core/pull/15560

   ### Flash Messages Tag (`g:flashMessages`)                                   
                                                  
                                                  
     Introduces a new `<g:flashMessages />` tag that renders `flash.message`, 
`flash.error`, and `flash.warning` as Bootstrap 
     5 dismissible alerts with appropriate styling (success, danger, and 
warning respectively).                                          
                                                                                
                                                         
     The tag automatically prevents duplicate rendering -- if called in both a 
page and its layout, only the first invocation produces
     output. All flash content is HTML-encoded to prevent XSS.
   
     The default layout (`main.gsp`) and all scaffolding templates now use this 
tag. If your application has custom views that render    
     flash messages manually, you can replace the boilerplate:
                                                                                
                                                         
     ```xml                                                          
     <%-- Before --%>
     <g:if test="${flash.message}">
         <div class="alert alert-primary" role="alert">${flash.message}</div>
     </g:if>                                                                    
                                                         
      
     <%-- After --%>                                                            
                                                         
     <g:flashMessages />                                             
   
     The tag supports optional attributes for customizing CSS classes, icons, 
ARIA role, and dismissibility. See the flashMessages tag
     reference for full details.
     ```
   
   This tag has been introduced to all default layouts so that every page has 
automatic access to displaying flash.* messages.   Multiple `<g:flashMessages 
/>`  are supported, but the first one rendered is prioritized.   Because of 
this, if a view (e.g.: scaffold view)  has a `<g:flashMessages />`, that 
flash.message location is prioritized over the layout location. 


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to