How do I get the referring URL within a Business Rule?

rushputin
Mega Expert

I can't find the answer to this, and I'm pretty sure it's because it's such a dumb question.

I've got a Record Producer, and in the script that handles it, I'd like to have it redirect to one place if we're working with a CMS site, and a different place if we're not (like the core application).

I figure this should be pretty easy: just look at your URL, and if it contains "ESS" or whatever setRedirect() to A, and if it doesn't setRedirect() to B.   The problem is... I can't figure out how to get that full referring URL.

5 REPLIES 5

mmongeau
Giga Guru

I needed access to the referring URL as well and with some inspection of the undocumented GlideTransaction object I was able to get the referring URL with this server-side code.



var transaction = GlideTransaction.get();


var request = transaction.getRequest();


var referer = request.getHeader("referer");



You could chain those methods together as well.



var referer = GlideTransaction.get().getRequest().getHeader("referer");



The request object is an instance of org.apache.catalina.connector.RequestFacade.



  Michael Mongeau


This sounds really promising. I'll have to give it a try.



Thanks!


Michael,


This is great. Thanks for sharing. Its exactly what I was looking for.


This returns null on IE. Any idea why? We are on Eureka currently.