My Grails 3.2.3アプリがポート9000で実行されていて、/api/mail/getUnreadCount
にGET
リクエストを行っていますが、そのURLに404エラーが表示されます。
マイURLMapping.groovy
た:
get "/api/$controller(.$format)?"(action: "index")
get "/api/$controller/$id(.$format)?"(action: "show")
"/api/$controller/$action?/$id?(.$format)?" {
constraints {
// apply constraints here
}
}
はまた、我々は、GrailsのURLマッピングのログを有効にする方法を、私を助けて?
アップデート1
class MailController {
static allowedMethods = [index: "GET", getUnreadCount: "GET"]
.....
.......
def getUnreadCount() {
User currentUserInstance = springSecurityService.getCurrentUser()
List counts = userService.getUnreadCounts(currentUserInstance)
respond(counts)
}
}
'/ api/mail/getUnreadCount'に '/ api/mail/getUnreadCount /'のように '/'を追加しようとしましたか? – mic4ael
はい、私は試しましたが、まだ問題はありますか? –
grailsアプリケーションは9000ポートで正しく動作していません。http:// localhost:9000 **を押してgrailsホームページを開くことができるかどうか確認してください。それが動作している場合は、あなたの**メール**コントローラを表示していますか? –