obtain url on server side ?

mach3_1986
Kilo Contributor

Hello,

Is there a way you can obtain the current url on server side ? (in a script include file)
Something that would retrieve something like "demo006.service-now.com/incident/weirdurl.do?param1=1".

I can't seem to find any solution to this. Any suggestion is welcomed.

Thx in advance for your help.

8 REPLIES 8

adiddigi
Tera Guru

I think you are looking for this :



gs.getSession().getStack().get(0);


blaine2
Tera Contributor

getStack() does not contain the URL from the current request.   The top URL in the stack is the previous request.   You can see this by careful testing without wrapper pages or by comparing the getStack values to the current URLs reported by gs.action.getGlideURI().


Hi,

 

I used the method that you have mentioned but it gives error

Error Message

Illegal access to method get(number) in class com.glide.sys.GlideStack
 
is it depricated??

I think there is a change in methods.

 

Please now  use gs.getSession().getUrlOnStack(); instead(Kingston).