From: Jason H. <jh...@gm...> - 2013-02-28 00:03:58
|
Hi Wolfgang Please find test case (3 small .xql files) pasted below to be uploaded to /db/apps/test_ev Logged output after submitting the form: 2013-02-28 10:52:14,192 [eXistThread-54] TRACE (XQueryURLRewrite.java [logResult]:643) - <dispatch xmlns="http://exist.sourceforge.net/NS/exist"> <forward url="process.xql"/> </dispatch> 2013-02-28 10:52:14,192 [eXistThread-54] TRACE (XQueryURLRewrite.java [service]:324) - URLRewrite took 2ms. 2013-02-28 10:52:14,192 [eXistThread-54] TRACE (XQueryURLRewrite.java [doRewrite]:552) - Forwarding to : org.exist.http.urlrewrite.PathForward@4a412f4b url: /rest/db/apps/test_ev/process.xql 2013-02-28 10:52:14,227 [eXistThread-53] TRACE (XQueryURLRewrite.java [service]:182) - /exist/view 2013-02-28 10:52:14,228 [eXistThread-53] TRACE (XQueryURLRewrite.java [service]:216) - Processing request URI: /exist/view thanks .. Jason controller.xql ========= xquery version "1.0"; declare variable $exist:resource external; let $action := request:get-parameter("action", ()) return if ($action eq 'process') then ( <dispatch xmlns="http://exist.sourceforge.net/NS/exist"> <forward url="process.xql" /> </dispatch> ) else <dispatch xmlns="http://exist.sourceforge.net/NS/exist"> <forward url="form.xql" /> </dispatch> form.xql ====== xquery version "3.0"; import module namespace response="http://exist-db.org/xquery/response"; response:stream( <html> <head> <title>portal</title> </head> <body> <h1>signup</h1> <p>Welcome blagh blagh.</p> <form action="/exist/apps/test_ev/?action=process" method="post"> <p>Your name: <input type="text" name="admin-name"/></p> <p>Your email: <input type="text" name="admin-email"/></p> <input type="submit" value="submit" /> </form> </body> </html>, "method=xhtml media-type=application/xhtml+html") process.xql ======== xquery version "3.0"; import module namespace response="http://exist-db.org/xquery/response"; response:stream( <html> <head> <title>portal</title> </head> <body> <h1>signup</h1> <p>thanks for that!</p> </body> </html>, "method=xhtml media-type=application/xhtml+html") |