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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 17, 20262026-05-17T16:28:50+00:00 2026-05-17T16:28:50+00:00

I have a WAR project and I am trying to store spring configuration files

  • 0

I have a WAR project and I am trying to store spring configuration files within the /WebContent/WEB-INF/Spring/ folder (as required by my employer), but when I do that I have not found a way to be able to reference those files within my junit tests. I was told today that I can modify my MANIFEST.MF file so that the spring configuration files are included, but I have not been able to successfully reference the files from the manifest file.

My first question is whether or not it is possible to reference files in the /WebContent/WEB-INF/Spring/ folder from my junits? If it is possible, how to the manifest file know where to look for the files? Are the links relative?

The folder structure for my WAR is as follows (structure is defined by the company I work for):

WARProject
 - src\
 - WebContent\
 - - WEB-INF\
 - - - Spring\
 - - - - App-config.xml
 - - - - Security.xml
 - - META-INF\
 - - - MANIFEST.MF

I appreciate any guidance you can provide.

Jeremy

  • 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-17T16:28:51+00:00Added an answer on May 17, 2026 at 4:28 pm

    If you are using Spring 2.5 or later and Spring’s TestContext framework, then you can simply annotate the test class with @ContextConfiguration(locations = {path/to/file})

    If you are loading an ApplicationContext yourself, then just make sure that /WebContent/WEB-INF/Spring/ is on the classpath and load the file with classpath:contextname.xml.

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

Sidebar

Related Questions

I have a web application (.war) that contains some static files (e.g. MS word
I'm using netbeans 6.7.1 and I have a maven web project (war file). I'd
I have 2 different webapps (package into different war files) which needs to share
Hopefully this will not spark a religious war... We have a web based app
I'm trying to configure my WAR project build to fail if the line or
I have a problem when trying to deploy my project in JBoss. The generated
I am trying to export a WAR file from Eclipse. I have a Dynamic
When trying to run an Eclipse Dynamic Web Project under a Tomcat setup using
I have a maven war project which produces webapp.war, and a maven 'skin' project
I have a WAR file for a Java project but when I try to

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.