# URLMappings

## Purpose

The `URLMappings` plug-in configures Grails' URL Mapping infrastructure.

## Examples

An example `UrlMapping` class:

    class UrlMappings {
        static mappings = {
            "/$controller/$action?/$id?" {
                constraints {
                    // apply constraints here
                }
            }
        }
    }

## Description

Refer to the section on URL Mapping in the Grails user guide which details how Grails' URL mappings work.

Configured Spring Beans:

- `grailsUrlMappingsHolderBean` - A org.codehaus.groovy.grails.web.mapping.UrlMappingsHolderFactoryBean factory bean that constructs a org.codehaus.groovy.grails.web.mapping.UrlMappingsHolder instance that stores all of the URL mappings.
- `urlMappingsTargetSource` - A Spring org.springframework.aop.target.HotSwappableTargetSource used in auto-reloading to automatically update URL mappings when changed.
- `grailsUrlMappingsHolder` - A Spring org.springframework.aop.framework.ProxyFactoryBean that proxies onto the actual `UrlMappingsHolder` instance using the `HotSwappableTargetSource`