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)}
精彩评论