Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 971143
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 16, 20262026-05-16T02:54:54+00:00 2026-05-16T02:54:54+00:00

I am using filters to handle authentication and some other pre-condition checks for a

  • 0

I am using filters to handle authentication and some other pre-condition checks for a Grails application. I’ve run into a situation where it’d be nice to ensure that filter A is always invoked before filter B.

According to the documentation the “filters are executed in the order they are defined” but it is unclear what that definition refers to. I am familiar with how that works for Java EE ServletFilters, where the sequence is declared by the order of corresponding tags in the web.xml, but as the deployment is handled automatically in Grails, I am not really sure where I could influence the order in which the filters are set up.

Is that possible at all in Grails, and if so, how?

Update

If several filters are declared within one class, it’s obvious that they’ll be executed in the order that they were declared. I am more concerned with filters defined in different classes and the sequence that those classes will be considered in.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-16T02:54:54+00:00Added an answer on May 16, 2026 at 2:54 am

    Molske is correct that they’re executed in the order defined in the class. One exception is that the first ‘before’ filter that returns false stops processing.

    There’s also a new configuration option ‘dependsOn’ that you can use to order different filter classes, i.e. that MyFilters2 runs after MyFilters1. See “6.6.4 Filter Dependencies” at http://grails.org/doc/latest/

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a piece of code that filters a list using LINQ, creates a
I am outputting content from my models to my templates, however some model fields
I am using GWT and RPC in my app. after session expires when I
So basically I have a form with browser filters for data I'm displaying. I
I have a Drupal view which should output a video player using flash. I
I need to convert all text to lowercase, but not using the traditional tr
I'm trying to create a dialog window using the following CSS: #blackOverlay { display:
First, here's my original question that spawned all of this . I'm using Appcelerator
I'm trying to create a default handler for .p7s/.p7b files in Android. I figured
I'm doing something like the guy in this post: is there a way to

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.