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 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
  • 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-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

Here is my situation: I have my mvc-config.xml file for my web service set
I have written a VERY simple MVC application which just displays a single string
I have a Windows Form project that I would like to migrate toward a
My ASP.NET MVC 2 application uses Entity Framework 4.0 for the data model. Following
Ok, so I am stumped on this issue. I have seen a lot of
First post inhere ever. So better make it a good one. I have a
I'm working with ASP.NET MVC but this really applies to any MVC framework. I
Using asp.net MVC in c#, I am making a call to a stored procedure
Ok... so here's my actual status: Been a PHP Scripter for way too long,
What I need to do is capture the result of an expression within an

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.