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

  • Home
  • SEARCH
  • 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 6228469
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 24, 20262026-05-24T09:23:39+00:00 2026-05-24T09:23:39+00:00

In a JSP-based web application, let’s say I’m hosting my static content on a

  • 0

In a JSP-based web application, let’s say I’m hosting my static content on a CDN, but during development I want serve that content from my web application — just to make life easy.

How do I make the URL for my static content dynamic in a way that any JSP can automatically see it?

Do I define some singleton class to contain all my settings and just grab an instance of that from my JSP? Is there some way to make some parameters available to all JSPs? Or is there some other way altogether?

  • 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-24T09:23:42+00:00Added an answer on May 24, 2026 at 9:23 am

    You need this set as request or servlet context attribute. It can be done in a Filter (per request) or (better, as BalusC suggested) – ServletContextListener. You put a request attribute called staticRoot and then all URLs to static resources: <img src="${staticRoot}/images/logo.ong" />

    The setting can be read at startup by the filter from a properties file (usually placed outside the .war file), so that you can supply different properties for different environments.

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

Sidebar

Related Questions

Hi I have a page in my java/jsp based web application which shows list
I want to provide a Java-based Web Service, but I don't require the features
I have an already developed web application based on struts 1.2 which contains jsp
I have simple web application based on JSP. Root of application looks like this:
Here's the scenario, I am working on a web-based application develped used JSP/Servlet technique,
I am a student and I have developed a web application based on JSP.
I'm looking to implement a simple web-based application. The main reason I want to
I am working on a web based application with JSP and servlets. I am
I'm somewhat newbie for WEB development based on JVM stack, but future project will
Everyone who's done any web application development in Scala knows that you can use

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.