browser does not execute redirects

Thursday, 17 October 2013 · 2 messages · last reply 19 Oct 2013
FE
Florian Eckey17 Oct 2013 20:18 #

Hi guys,

i have a problem with redirects in basex. I have following function:

declare %restxq:path("anyPath")  function {
   "Some XQuery Code",
   <restxq:redirect xmlns:restxq="http://exquery.org/ns/restxq
">/restxq/anyOtherPath</restxq:redirect>
};

This function I call with http://localhost/restxq/anyPath in my browser (Chrome). So I expect, that the browser gets the redirect an executes it. But it only returns: <restxq:redirect xmlns:restxq="http://exquery.org/ns/restxq ">/restxq/anyOtherPath</restxq:redirect> instead of the redirected page.

In the attachment there is a screenshot.

Is there anyone with the same problem or a solution?

Regards,

Florian

PS: Are there any BaseX developer meetings in Germany?

CG
Christian Grün19 Oct 2013 02:05 #

Hi Florian,

Quoted text · Florian Eckey · 5 lines
> declare %restxq:path("anyPath") function { > "Some XQuery Code", > <restxq:redirect > xmlns:restxq="http://exquery.org/ns/restxq">/restxq/anyOtherPath</restxq:redirect> > };

please note that redirects cannot be mixed with additional output. Instead, what you can e.g. do is to perform updates and then use a redirect to another URL. I guess this info may need to be added in our documentation [1]..

Hope this helps, Christian

[1] http://docs.basex.org/wiki/RESTXQ#Forwards_and_Redirects

Quoted text · Florian Eckey · 26 lines
> > This function I call with http://localhost/restxq/anyPath in my browser > (Chrome). > So I expect, that the browser gets the redirect an executes it. But it only > returns: > <restxq:redirect > xmlns:restxq="http://exquery.org/ns/restxq">/restxq/anyOtherPath</restxq:redirect> > instead of the redirected page. > > In the attachment there is a screenshot. > > Is there anyone with the same problem or a solution? > > Regards, > > Florian > > PS: Are there any BaseX developer meetings in Germany? > > > > _______________________________________________ > BaseX-Talk mailing list > BaseX-Talk at mailman.uni-konstanz.de > https://mailman.uni-konstanz.de/mailman/listinfo/basex-talk >

⚡Generated with XQuery