Search in sources :

Example 6 with UrlMappingInfo

use of grails.web.mapping.UrlMappingInfo in project grails-core by grails.

the class DefaultUrlMappingsHolder method matchStatusCode.

public UrlMappingInfo matchStatusCode(int responseCode, Throwable e) {
    for (UrlMapping mapping : mappings) {
        if (mapping instanceof ResponseCodeUrlMapping) {
            ResponseCodeUrlMapping responseCodeUrlMapping = (ResponseCodeUrlMapping) mapping;
            final UrlMappingInfo current = responseCodeUrlMapping.match(responseCode);
            if (current != null) {
                if (responseCodeUrlMapping.getExceptionType() != null && responseCodeUrlMapping.getExceptionType().isInstance(e)) {
                    return current;
                }
            }
        }
    }
    return null;
}
Also used : UrlMapping(grails.web.mapping.UrlMapping) UrlMappingInfo(grails.web.mapping.UrlMappingInfo)

Aggregations

UrlMappingInfo (grails.web.mapping.UrlMappingInfo)6 UrlMapping (grails.web.mapping.UrlMapping)5 HashSet (java.util.HashSet)2 ConcurrentLinkedHashMap (com.googlecode.concurrentlinkedhashmap.ConcurrentLinkedHashMap)1 Constrained (grails.gorm.validation.Constrained)1 ConstrainedProperty (grails.gorm.validation.ConstrainedProperty)1 Binding (groovy.lang.Binding)1 Closure (groovy.lang.Closure)1 GroovyShell (groovy.lang.GroovyShell)1 Script (groovy.lang.Script)1 ArrayList (java.util.ArrayList)1 List (java.util.List)1 GrailsWebRequest (org.grails.web.servlet.mvc.GrailsWebRequest)1 HttpMethod (org.springframework.http.HttpMethod)1