java - how to get referrer from ContainerRequestContext object -
how referrer url containerrequestcontext
object.
please find code snippet below,
public void filter(containerrequestcontext requestcontext) { applicationuser user = (applicationuser) cachemanagerbase.getinstance().getapplicationusercache().getcurrentuser(); requestcontext.setsecuritycontext(new usercontext(user)); }
there's couple of different options, simplest is
string referrer = requestcontext.getheaderstring("referer");
that might return null
if header isn't set.
Comments
Post a Comment