Play Framework Routes无效 [英] Play Framework Routes not working

查看:460
本文介绍了Play Framework Routes无效的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我只是想跟随ZenTasks教程( http:// www。 Play框架的playframework.com/documentation/2.1.0/JavaGuide4 )。我似乎无法让登录页面工作。

I am just trying to follow along with the ZenTasks tutorial (http://www.playframework.com/documentation/2.1.0/JavaGuide4) for the Play Framework. I can't seem to even get the Login page to work however.

我正在使用 play~run 命令。当导航到 http:// localhost:9000 / login 时,错误是

I am running this project with the play ~run command. When navigating to http://localhost:9000/login the error is

Action not found For request 'GET /login'
These routes have been tried, in this order:
1 GET/controllers.Application.index()
2 GET/assets/$file<.+>controllers.Assets.at(path:String = "/public", file:String)`

我的路线文件看起来像

# Routes
# This file defines all application routes (Higher priority routes first)
# ~~~~

# Home page
GET     /                           controllers.Application.index()

# User athentication
GET     /login                      controllers.Application.login()
POST    /login                      controllers.Application.authenticate()
GET     /logout                     controllers.Application.logout()

# Map static resources from the /public folder to the /assets URL path
GET     /assets/*file               controllers.Assets.at(path="/public", file)

和Application.login,验证和注销功能都可以正常编译。我在这里错过了一些非常容易的东西,因为我不知道出了什么问题?

and the Application.login, authenticate, and logout functions all compile properly. Am I missing something incredibly easy here, because I can't tell what is going wrong?

推荐答案

看起来路线文件不是编译得当。可能,你应该在游戏机上干净并再试一次

Looks like the routes file wasn't compiled properly. probably, you should do a clean in the play console and try again

$ play clean-all

这篇关于Play Framework Routes无效的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆