I have a fairly standard Spring/Hibernate Java project where I need to set a cookie based on the domain of the environment I’m in(Local, Test and Prod).
$.cookie("[cookie_name]", "[cookie_data]", { expires: 7, path: '/', domain: '', secure: false });
Is there a JSP/JSTL tag or a way in expression language to determine the domain the servlet container is running on? Or is there a similar method in javascript/jQuery?
For instance, if I am running the app on a Tomcat Server on test, I want the IP of the test server or if I am running on production I want the domain name of the prod site.
I am looking for something along the lines of ${applicationScope.domain}
source:
http://www.steve-farmer.com/examples/el/ui/req-server.jsp
http://www.steve-farmer.com/examples/el/ui/req-misc.jsp