How can I add an URL fragment (#xyz) to a link created by the Redirect method?
#xyz
Redirect
I want something like this:
Redirect(routes.Comment.get(itemId) + "#xyz")
You can get the url form the route using .url (which contains a relative url). Redirect needs two parameters to accept a string to redirect to
so, Redirect(routes.Comment.get(itemId).url + "#xyz", SEE_OTHER) should work
Redirect(routes.Comment.get(itemId).url + "#xyz", SEE_OTHER)
Edited when I realized Redirect() takes a Call and not a string
With Play Framework 2.4 is possible do this:
Redirect(routes.Comment.get(itemId).withFragment("#xyz").toString)