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 8689611
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 12, 20262026-06-12T23:41:26+00:00 2026-06-12T23:41:26+00:00

In a spring mvc application, what is the best way to reference the filesystem?

  • 0

In a spring mvc application, what is the best way to reference the filesystem?

Say I want to know the root of my applications path?

Should I create a properties file and hard code this value in the property file, then create different versions for production and development environments?

I might want to reference a file outside of my application also, so I guess a property file is best suited for this correct?

  • 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-06-12T23:41:28+00:00Added an answer on June 12, 2026 at 11:41 pm

    I understood your question as a config/release problem, not coding problem. If you want to access file (say with absolute path) there are different ways to achieve it:

    • if you use maven to build your app. create maven profile with corresponding property, e.g. file.path and at build-time fill the property to spring bean (e.g. a String)

    • create different properties files, which containing config parameters for different environments. and let maven fill the placeholder in spring conf, which properties file should be used.

    • use spring profile. put server-relevant beans in profiles, and your application choose the right profile (the set of beans) at runtime.

    • well if you have different databases for different environments, you could consider to save some config parameters in a config table. And application loads those data when it starts or when it needs. At least this is another option.

    did that answer your question? or I am just talking about something else?…

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

Sidebar

Related Questions

I want to create a multi-module (maven) spring MVC application, with modules like: web
I have a Spring Mvc application and i want when the user clicks on
My spring mvc application is broken into modules. My services are in their own
I have a Spring MVC application which uses FreeMarker as View technology (But maybe
I have a Spring MVC application trying to use a rich domain model, with
In my Spring MVC application I am using DTO in the presentation layer in
I have a spring mvc application that I have broken up into separate maven
I'm using Spring's form tag library in a Spring MVC application that I am
I'm using itext to generate pdf in my spring mvc application. The pdf is
In Spring MVC Hibernate application , when i am trying to use properties file

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.