开发者

URL generation weird in Playframework

I am facing a wierd issue regarding in URL generation in Playframework.

Here is my code snippet in template:

@{Rooms.list(customerId?:customerId, location?:location, roomId?:roomId)}

Obviousely I wanna to generate a the URL like this:

/rooms/list?customer=1&location=asdf&roomId=1

开发者_开发知识库

But finally I got this:

/rooms/list?customer=1&location=asdf&roomId=1

I traced down the play source code and found this in "GroovyTemplate":

if (template.template.name.endsWith(".html") || template.template.name.endsWith(".xml")) {
    def.url = def.url.replace("&", "&");
}

Could anybody tell what's the purpose of this replacement? How can I get my URL correctly?

Thanks


not sure if this answers your question, but you could try the following:

@{Rooms.list().add("customerId", customerId).add("location", location).add("roomId", roomId)}
0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜