但是手动拷贝,太愚蠢了(我们可是程序猿,we do something incredible !!!),可以用python的watchdog写个监控软件,当文件被改动后自动拷贝,并且用selenium自动打开谷歌浏览器,刷新页面。用pyinstaller打包成exe。
post 请求
binding.scala
@dom def render =
{
<div>
<hr/>
{
val formData = new FormData()
formData.append("username", "my name is jerry")
formData.append("password", "are you okay")
val result = FutureBinding(Ajax.post("/hello", data = formData))
result.bind match
{
case None =>
<div>you got nothing</div>
case Some(Failure(exception)) =>
<div>{ "i am the exception " + exception.getMessage + exception.getStackTrace }</div>
case Some(Success(response)) =>
val user=JSON.parse(response.responseText)
<div>
<p>username={user.username.toString}</p>
<p>password={user.password.toString}</p>
<p>password={user.name.toString}</p>
<p>response.responseText= new text={JSON.stringify(response.responseText)}</p>
</div>
}
}
<hr/>
</div>
}
@dom def render =
{
val result = FutureBinding(Ajax.get("/info"))
<div>
{
result.bind match
{
case None =>
<div>you got nothing</div>
case Some(Failure(exception)) =>
<div>{ "i am the exception " + exception.getMessage + exception.getStackTrace }</div>
case Some(Success(response)) =>
val info=JSON.parse(response.responseText)
<div>
info.code={info.code.toString}
<p>response.responseText= new text={JSON.stringify(info)}</p>
</div>
}
}
</div>
}