转义分号路由playframework 2.0.2
我想用playframework做一个重定向函数。到目前为止,我的路线上都有这个转义分号路由playframework 2.0.2,playframework,routes,playframework-2.0,uri,Playframework,Routes,Playframework 2.0,Uri,我想用playframework做一个重定向函数。到目前为止,我的路线上都有这个 GET /redirect com.test.redirect(redirecturl: String?="") 和我的控制器: public static Result redirect(String redirecturl) { return redirect(redirectURL); } 这很好,但当我传递包含分号的url时,我遇到了一个问题” 如果我去 http
GET /redirect com.test.redirect(redirecturl: String?="")
和我的控制器:
public static Result redirect(String redirecturl) {
return redirect(redirectURL);
}
这很好,但当我传递包含分号的url时,我遇到了一个问题”
如果我去
http:localhost:9000/重定向?重定向URL=http://www.google.com;TestAfter分号
它将我重定向到google.com,但在我的日志中,重定向URL仅等于“”在分号后停止
有办法逃脱吗?或者在播放中执行自定义路由?您应该能够通过在路由文件中使用自定义正则表达式来转义它。这在中进行了描述。 基本上,类似以下的方法应该可以工作:
GET /redirect/$url<.+> com.test.redirect(url: String?="")
GET/redirect/$url com.test.redirect(url:String?=“”)
您应该能够使用routes文件中的自定义正则表达式对其进行转义。这在中进行了描述。
基本上,类似以下的方法应该可以工作:
GET /redirect/$url<.+> com.test.redirect(url: String?="")
GET/redirect/$url com.test.redirect(url:String?=“”)