Grails - GSP Tag - grep

Tag - grep

Description

Uses the Groovy JDK grep method to iterate over each element of the specified object that match the specified "filter" attribute. The filter can be different instances such as classes, regex patterns etc.

Parameters

  • in - The object to iterative over
  • filter - The filter instance

Examples

Stephen King's non-fiction Books:
<g:grep in="${books}" filter="NonFictionBooks.class">
     <p>Title: ${it.title}</p>
</g:grep>