Re: Name of executing script

Joe Wicentowski <[email protected]>
Newsgroups gmane.text.xml.exist
Message-ID <CAHwerk0W+N66afzHyL7XyKa0ebKCyFQddyibChz0GULq=V2WLw@mail.gmail.com>
Hi Kit,

Sorry, I meant to reply earlier. The function that first came to mind
was system:get-module-load-path(), but perhaps you're looking for
the various request:get-* functions, one of which you already found.

I agree, response:redirect-to() is cumbersome in its need for an absolute
URL. But I think it literally dumps the URI you supply straight into the
Location header in the HTTP 302 response, so from that perspective,
its behavior makes sense.

Joe

On Wed, May 24, 2023 at 6:32 AM Chris Wallace <[email protected]> wrote:

> Here is one way to get it:
>
> tokenize(request:get-effective-uri(),"/")[last()]
>
> By way of context, when executing a response:redirect-to() , the URI needs
> the script name even if the redirect is to the current script. Scripts are
> more maintainable when that name doesn't have to be hard-coded.
>
>
>
> On Fri, May 19, 2023 at 8:07 AM Chris Wallace <[email protected]>
> wrote:
>
>> Help - I've forgotten how to get the name of the executing script.
>>
>> Chris
>>
> _______________________________________________
> Exist-open mailing list
> [email protected]
> https://lists.sourceforge.net/lists/listinfo/exist-open
>

_______________________________________________
Exist-open mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/exist-open
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.