obtain url on server side ?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎09-11-2013 11:51 PM
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.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎09-17-2013 12:46 AM
Hello Abhiram,
Thx for your answer. Your solution would work good in a normal behavior when session is already established.
In my case, what i am looking for is to obtain the requested url before the session has been established.
More details: The script include DetermineMobileDevice runs before session is established. I am trying a custom mobile device detection but i need the requested url.
Is there a way to obtain this in that script ?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎09-17-2013 01:54 AM
Hi all,
I found a way to do it after all.
Again, the scope. I wanted to customize the DetermineMobileDevice script in order to return true/false based on user_agent + url (specifically, the CMS site name accessed).
What i found out is that:
- DetermineMobileDevice runs once, before session is established and befor esetting cookies on the client.
- My CMS sites are login form based, thus, before user is authenticated, the entry page is always the site login page.
- I can use the gs.action.getGlideURI() in the DetermineMobileDevice script that will retrieve something like: "view_content.do?/=&sysparm_is_login=true&sysparm_stack=no&sysparm_sys_id=GUID"
- GUID is always the sys_id of the login page of the site.
This allows me to customize the script based on these sys_id of each login page.
Not sure, again, if it is the best way. But it is how i managed to work around it...
Thx for your suggestions.
Alin
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎11-27-2015 09:55 PM
Hi, in case that it helps to others that reference this thread due to it's title. The URL processed on the server side can be retrieved by doing something like the following:
gs.getProperty("glide.servlet.uri") + gs.action.getGlideURI()
Thanks,
Berny
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎12-17-2018 03:19 AM
I think there is a change in methods.
Please now use gs.getSession().getUrlOnStack(); instead(Kingston).