API / Apache Grails Interview questions
Explain the lifecycle of a request in a Grails application?
A request in Grails passes through several layers built on top of the underlying Spring Boot/servlet stack before a response is generated, with Grails' own conventions handling most of the routing and rendering decisions along the way.
The request first passes through Spring Boot's own dispatching machinery, then Grails' UrlMappings resolve which controller and action should handle it, either via an explicit mapping or the default convention. Before the action itself runs, any configured interceptors get a chance to inspect or short-circuit the request (for things like authentication checks), and after the controller action executes — typically by delegating real work to a service — Grails resolves and renders the matching GSP view (or serializes a direct response for a REST-style action) before interceptors run again on the way out and the final response is sent.
This layered structure is what lets Grails add its own conventions (URL mapping, view resolution, interceptors) cleanly on top of the standard servlet request lifecycle rather than replacing it outright.
More Related questions...