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

Popular posts from this blog

php - Wordpress website dashboard page or post editor content is not showing but front end data is showing properly -

How to get the ip address of VM and use it to configure SSH connection dynamically in Ansible -

javascript - Get parameter of GET request -