GlideTransaction.get().response.sendRedirect broken in Jakarta / sendRedirect
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎12-05-2017 01:29 AM
Hello,
Our instance uses a couple of GlideTransaction.get().response.sendRedirect() calls. It was ok on Helskinki version but is broken on Jakarta.
We receive the following error message "Attempted script access to inaccessible member denied - com.glide.sys.Transaction:getResponse:()Ljavax/servlet/http/HttpServletResponse;
Evaluator: java.lang.SecurityException: Illegal access to method getResponse in class com.glide.sys.Transaction".
I've looked in the community forum and find that this API was not documented. Therefore ServiceNow has certainly decided to change something or decided to restrict his usage.
Any idea how to get the same functionality ?
Thanks and regards
Jean-Luc
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎01-18-2018 04:53 AM
After playing around a bit. I got it working with:
g_response.sendRedirect(
ritm.getLink().toString()
);
sees encoding it was adding extra %25 where they weren't needed
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎01-18-2018 05:29 AM
Maybe you can share the code in order to compare both methods ?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎01-18-2018 05:50 AM
https://developer.servicenow.com/app.do#!/api_doc?v=kingston&id=c_GlideServletResponseScopedAPI
Processor Script has g_response.sendRedirect()...for temporary client redirection ....
Can we use a processor instead of current Transaction API or maybe inside the current logic maybe we can pass the URL as sysparm_name... as in GlideServletRequest API we have access to HttpServletRequest object.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎01-19-2018 01:17 AM
To compare i literally output each part to gs.info and compared with the full URL when loaded a ticket in the browser. I noticed a load of %25's just before 3D. Removed those and all worked ok. So figured it must be the encoding i.e. encodeURIComponent(ritm.getLink(). May not be the same in your case.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎01-19-2018 01:21 AM
Yes I think this is not the same problem,
However your troubleshooting may help others in the same case
