Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7438035
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 29, 20262026-05-29T10:29:34+00:00 2026-05-29T10:29:34+00:00

I have a fairly standard Spring/Hibernate Java project where I need to set a

  • 0

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}

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-29T10:29:35+00:00Added an answer on May 29, 2026 at 10:29 am
    • Protocol: ${pageContext.request.protocol}
    • Remote Address: ${pageContext.request.remoteAddr}
    • Remote Host: ${pageContext.request.remoteHost}
    • Remote Port: ${pageContext.request.remotePort}
    • Scheme:${pageContext.request.scheme}
    • Secure: ${pageContext.request.secure}
    • Local Address: ${pageContext.request.localAddr}
    • Local Name: ${pageContext.request.localName}
    • Local Port: ${pageContext.request.localPort}
    • Server Name: ${pageContext.request.serverName}
    • Server Port: ${pageContext.request.serverPort}

    source:

    http://www.steve-farmer.com/examples/el/ui/req-server.jsp
    http://www.steve-farmer.com/examples/el/ui/req-misc.jsp

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a fairly standard inheritance situation in my current LINQ-to-SQL project. I have
We have a Java web application that uses Spring and Hibernate and has a
I've got a fairly standard Spring webapp, and I have a number of custom
I have a fairly standard Java EE6 web application using JPA 2 with dependency
I have a fairly standard rails app and would like to be able to
I have a fairly standard OLTP normalised database and I have realised that I
I have a fairly standard .Net MVC Controller method: public ActionResult Add(Customer cust) {
I have a fairly simple addition to the HTTP standard. An ambitious goal I
I'm fairly new to PHP and have built a medium sized website using standard
I have a fairly standard blog app with the usual post and comments controller/models

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.