Scala/Lift- How do I do a page redirect with params? -
i need redirect requests 'toolsearch' page 'search' page parameters
so localhost:8080/toolsearch#?q=20
needs redirected localhost:8080/search#?q=20
i trying use boot add liftrules redirect
liftrules.statelessrewrite.prepend { case rewriterequest(parsepath("toolsearch" :: nil, "", x, y), z, s) => { rewriteresponse("search" :: "index" :: nil, map("page" -> "search")) //works browser address bar says 'toolsearch' not 'search // s.redirectto("/search") //throws net.liftweb.http.responseshortcutexception: shortcut // jscmds.redirectto("/search") //doesnt compile } }
any appreciated. thanks.
after spending time trying different things solution found works:
liftrules.dispatch.prepend { case req("toolsearch" :: nil, _, _) =>{ () => full(redirectresponse("/search")) } }
please let me know if have better solution.
Comments
Post a Comment