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"))   } } 

ref

please let me know if have better solution.


Comments

Popular posts from this blog

account - Script error login visual studio DefaultLogin_PCore.js -

xcode - CocoaPod Storyboard error: -