我正在尝试使用Grails的RESTful API插件创建一个restful api。我试图点击http://localhost:8080/grails-api/qapi/searchs?query=abc
,但我收到的是404。这是怎么回事?
DEBUG mapping.DefaultUrlMappingsHolder - Attempting to match URI [/qapi/searchs] with pattern [500]
DEBUG mapping.DefaultUrlMappingsHolder - Attempting to match URI [/qapi/searchs] with pattern [/]
DEBUG mapping.DefaultUrlMappingsHolder - Attempting to match URI [/qapi/searchs] with pattern [/qapi/(*)]
DEBUG mapping.DefaultUrlMappingsHolder - Matched URI [/qapi/searchs] with pattern [/qapi/(*)], adding to posibilities
DEBUG mapping.DefaultUrlMappingsHolder - Attempting to match URI [/qapi/searchs] with pattern [/api/(*)]
DEBUG mapping.DefaultUrlMappingsHolder - Attempting to match URI [/qapi/searchs] with pattern [/api/(*)/(*)]
DEBUG mapping.DefaultUrlMappingsHolder - Attempting to match URI [/qapi/searchs] with pattern [/api/(*)/(*)/(*)]
DEBUG mapping.DefaultUrlMappingsHolder - Attempting to match URI [/qapi/searchs] with pattern [/(*)/(*)?/(*)?(.(*))?]
DEBUG mapping.DefaultUrlMappingsHolder - Matched URI [/qapi/searchs] with pattern [/(*)/(*)?/(*)?(.(*))?], adding to posibilities
DEBUG mapping.DefaultUrlMappingsHolder - Attempting to match URI [/qapi/searchs] with pattern [/dbdoc/(*)?/(*)?/(*)?/(*)?]
DEBUG mapping.DefaultUrlMappingsHolder - Attempting to match URI [/qapi/searchs] with pattern [/api/(*)/(*)/(*)/(*)]
DEBUG mapping.DefaultUrlMappingsHolder - Attempting to match URI [/qapi/searchs] with pattern [/assets/(**)]
DEBUG mapping.DefaultUrlMappingsHolder - Attempting to match URI [/qapi/searchs] with pattern [500]
DEBUG mapping.DefaultUrlMappingsHolder - Attempting to match URI [/qapi/searchs] with pattern [/]
DEBUG mapping.DefaultUrlMappingsHolder - Attempting to match URI [/qapi/searchs] with pattern [/qapi/(*)]
DEBUG mapping.DefaultUrlMappingsHolder - Matched URI [/qapi/searchs] with pattern [/qapi/(*)], adding to posibilities
DEBUG mapping.DefaultUrlMappingsHolder - Attempting to match URI [/qapi/searchs] with pattern [/api/(*)]
DEBUG mapping.DefaultUrlMappingsHolder - Attempting to match URI [/qapi/searchs] with pattern [/api/(*)/(*)]
DEBUG mapping.DefaultUrlMappingsHolder - Attempting to match URI [/qapi/searchs] with pattern [/api/(*)/(*)/(*)]
DEBUG mapping.DefaultUrlMappingsHolder - Attempting to match URI [/qapi/searchs] with pattern [/(*)/(*)?/(*)?(.(*))?]
DEBUG mapping.DefaultUrlMappingsHolder - Matched URI [/qapi/searchs] with pattern [/(*)/(*)?/(*)?(.(*))?], adding to posibilities
DEBUG mapping.DefaultUrlMappingsHolder - Attempting to match URI [/qapi/searchs] with pattern [/dbdoc/(*)?/(*)?/(*)?/(*)?]
DEBUG mapping.DefaultUrlMappingsHolder - Attempting to match URI [/qapi/searchs] with pattern [/api/(*)/(*)/(*)/(*)]
DEBUG mapping.DefaultUrlMappingsHolder - Attempting to match URI [/qapi/searchs] with pattern [/assets/(**)]
DEBUG filter.UrlMappingsFilter - No match found, processing remaining filter chain
"/$controller/$action?/$id?(.$format)?"{
constraints {
// apply constraints here
}
}
// Default controller to handle RESTful API requests.
// Place URL mappings to specific controllers BEFORE this mapping.
//
"/api/$pluralizedResourceName/$id"(controller:'restfulApi') {
action = [GET: "show", PUT: "update",
DELETE: "delete"]
parseRequest = false
constraints {
// to constrain the id to numeric, uncomment the following:
// id matches: /\d+/
}
}
"/api/$pluralizedResourceName"(controller:'restfulApi') {
action = [GET: "list", POST: "create"]
parseRequest = false
}
// Support for nested resources. You may add additional URL mappings to handle
// additional nested resource requirements.
//
"/api/$parentPluralizedResourceName/$parentId/$pluralizedResourceName/$id"(controller:'restfulApi') {
action = [GET: "show", PUT: "update", DELETE: "delete"]
parseRequest = false
constraints {
// to constrain the id to numeric, uncomment the following:
// id matches: /\d+/
}
}
"/api/$parentPluralizedResourceName/$parentId/$pluralizedResourceName"(controller:'restfulApi') {
action = [GET: "list", POST: "create"]
parseRequest = false
}
"/qapi/$pluralizedResourceName"(controller:'restfulApi') {
action = [GET: "list", POST: "search"]
parseRequest = false
}
"/"(view:"/index")
"500"(view:'/error')