我正在尝试建立一个特定静态文件的路由,但我正在尝试的所有内容都以错误结束.
我做了3次不同的尝试:
1.
GET /file staticFile:/public/html/file.html
Run Code Online (Sandbox Code Playgroud)
我得到的错误:
Compilation error
string matching regex `\z' expected but `:' found
Run Code Online (Sandbox Code Playgroud)
2.
GET /file controllers.Assets.at(path="/public/html", "file.html")
Run Code Online (Sandbox Code Playgroud)
我得到的错误:
Compilation error
Identifier expected
Run Code Online (Sandbox Code Playgroud)
3.
GET /file controllers.Assets.at(path="/public/html", file="file.html")
Run Code Online (Sandbox Code Playgroud)
我得到的错误:(这是最奇怪的)
Compilation error
not enough arguments for method at: (path: String, file: String)play.api.mvc.Call. Unspecified value parameter file.
Run Code Online (Sandbox Code Playgroud)
关于第3个错误的奇怪部分是它被抛出在以下行的不同文件(app/views/main.scala.html)中:
<link rel="stylesheet" media="screen" href="@routes.Assets.at("stylesheets/main.css")">
Run Code Online (Sandbox Code Playgroud)
所有这些方法都可以在stackoverflow上的官方文档和/或线程中找到.我在这里错过了什么?
谢谢.
有没有人知道是否有任何Sublime Text 2软件包可用于为SpecFlow/Gherkin规范文件启用语法高亮显示?
随着玩!框架2.0,使用安全特征:
如果我让用户浏览到未经身份验证的网站的多个部分,但是在某些操作上需要进行身份验证,如何在身份验证之前将它们重定向到原始网址,而不是所有人都使用相同的网址?
Play的这个问题也有类似的要求!1.x Playframework的安全模块在登录后没有重定向到原始URL.
但是据我所知,原始网址的flash参数在2.0中不可用.
基本上我正在寻找的变化将在authenticate方法处理程序中
def authenticate = Action { implicit request =>
loginForm.bindFromRequest.fold(
formWithErrors => BadRequest(html.login(formWithErrors)),
user => Redirect(routes.Application.index).withSession(Security.username -> user._1)
)
}
Run Code Online (Sandbox Code Playgroud)
某种Redirect(originalRequestUrl)会很方便.
有关清洁解决方案的任何想法?
我使用STS插件从Spring模板创建一个Spring MVC项目.但是当我运行应用程序时出现错误:
org.apache.jasper.JasperException: /WEB-INF/views/home.jsp(1,63) Unable to read TLD "META-INF/c.tld" from JAR file "file:/H:/workspace/.metadata/.plugins/org.eclipse.wst.server.core/tmp1/wtpwebapps/imgateway/WEB-INF/lib/jstl-1.2.jar": org.apache.jasper.JasperException: Failed to load or instantiate TagLibraryValidator class: org.apache.taglibs.standard.tlv.JstlCoreTLV
Run Code Online (Sandbox Code Playgroud)
有人遇到过这种问题吗?
我有一个Play项目.不幸的是,我反序列化了一些使用scala 2.9.2序列化的case类.由于play使用2.9.1,因此存在InvalidClassException.
Caused by: java.io.InvalidClassException: scala.Option; local class incompatible: stream classdesc serialVersionUID = 2832403187243187948, local class serialVersionUID = 7113474029577970182
Run Code Online (Sandbox Code Playgroud)
是否有可能强制使用scala 2.9.2?游戏项目配置似乎神奇地做了很多.没有多少projects/Build.scala
.
import sbt._
import Keys._
import PlayProject._
object ApplicationBuild extends Build {
val appName = "myproj"
val appVersion = "1.0-SNAPSHOT"
}
Run Code Online (Sandbox Code Playgroud)
由于2.9.2与2.9.1二进制兼容,我应该可以强制使用它 - 但我不知道如何!
更新:添加scala 2.9.2作为依赖项给我以下错误.
[error] {file:/home/schmmd/repo/openie-demo/}openiedemo/*:update: Version specified for dependency org.scala-lang#scala-lang;2.9.2 differs from Scala version in project (2.9.1).
Run Code Online (Sandbox Code Playgroud) scala中的play框架表单验证工作遵循我的Signup对象,它在"mapping"(":"对象Forms中方法映射缺少参数的行中给出了一个错误;如果你想把它当作`_',请使用`_'这个方法部分应用的功能"
case class UserRegistration(username: String, password1: String, password2: String)
val loginForm = Form(
mapping(
"username" -> email,
"password1" -> text,
"password2" -> text
)
(UserRegistration.apply)(UserRegistration.unapply)
verifying ("Passwords must match", => f.password1 == f.password2)
)
Run Code Online (Sandbox Code Playgroud) scala ×2
gherkin ×1
git ×1
gitorious ×1
java ×1
jsp ×1
merge ×1
routes ×1
specflow ×1
spring ×1
spring-mvc ×1
static-files ×1
sublimetext ×1
sublimetext2 ×1
tomcat ×1