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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 13, 20262026-05-13T22:09:42+00:00 2026-05-13T22:09:42+00:00

I have a Spring Web MVC application that I’d like to serve a large,

  • 0

I have a Spring Web MVC application that I’d like to serve a large, partially generated file.

I’ve added that file to my WebContent directory and all works fine there. However, I’d also like to access that file from my various build/deploy scripts, which read and parse the file.

My current approach is to keep a copy of the file under the src directory as well as the WebContent directory. When serving the file from the web, it uses WebContent.

When serving the file for the build scripts, it uses the following spring config:

  <bean id="ringCodeData" class="com.myapp.data.RingCodeData">
     <property name="rulesInputFile" value="classpath:resources/rules_copy.xml" />
     <!-- <property name="rulesInputFile" value="classpath:../WebContent/rules.xml" />    -->
     <!-- <property name="rulesInputFile" value="file:/WebContent/rules.xml" /> -->
  </bean>

As you can see, I’ve tried several different approaches to get the two to refer to the same file (without resorting to copies).

File paths don’t seem to work since they’re based on the current directory, that changes based on whether I call a given utility class from Eclipse or from the build scripts.

How can I get these to refer to the same file?

The only other thought I have at the moment is to try to setup Spring MVC to stream the file from the classpath directory.

  • 1 1 Answer
  • 1 View
  • 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-13T22:09:42+00:00Added an answer on May 13, 2026 at 10:09 pm

    Your best bet is likely placing it in /WEB-INF/classes (or, if you’re using an IDE, just the project’s src/source folder) and use <jsp:include> to include it.

    <jsp:include page="/WEB-INF/classes/resources/rules_copy.xml" />
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

So I have a spring mvc web application that I built in IntelliJ 9,
I'm working on a Spring MVC 3 web application, I have some JSPs that
I have a spring web app that uses Hibernate and Velocity. It's an MVC
Hello I'm building a Spring MVC web application that runs on Tomcat 6.0.20 and
I'm trying to make this 2-player web game application using Spring MVC. I have
I have a Spring Web MVC application where i need to use an external
I am using Spring Web MVC for my application. I have 1 dropdown list
I have this idea for a small-medium web application that I would like to
I have my web application written in Spring MVC. It is quite simple app
I have a simple Spring MVC application that looks up some user details from

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.