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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 17, 20262026-06-17T19:22:19+00:00 2026-06-17T19:22:19+00:00

In my application I have placed the ApplicationContext xml file in src and the

  • 0

In my application I have placed the ApplicationContext xml file in src and the project is working fine.
Can we place the ApplicationContext.xml in our WebContent or Web-Inf folder?

Also I want to know if I can place my properties file in WebContent.

Since I have placed my ApplicationContext.xml in src, I placed my properties file in src and that worked fine. Below is the code for it

<bean id="licenseSettings"
    class="org.springframework.beans.factory.config.PropertyPlaceholderConfigurer">
    <property name="location" value="classpath:LicenseSettings.properties" />
</bean>

I tried putting the properties file in WebContent/conf but the properties were not read succesfully.

My question is, can we put ApplicationContext.xml and properties file somewhere inside WebContent folder?

Update: I put my ApplicationContext.xml in WEB-INF/classes and it was read successfully using ApplicationContext ctx = new ClassPathXmlApplicationContext("ApplicationContext.xml");

My only question remaining unanswered is, where shall I put my properties file and where is it appropriate to be put in?

  • 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-17T19:22:21+00:00Added an answer on June 17, 2026 at 7:22 pm

    There are couple of ways you can do this:

    In Spring MVC, You mention dispatcher-servlet in web.xml as follows

     <servlet>
              <servlet-name>mvc-dispatcher</servlet-name>
                <servlet-class>
                          org.springframework.web.servlet.DispatcherServlet
                </servlet-class>
                <load-on-startup>1</load-on-startup>
    </servlet>
    

    Now this by default will look for a file named mvc-dispatcher-servlet.xml. That is, the servlet name appended by -servlet.xml. And it will look for this file in class path.

    Alternatively which fits your case, if you already have xml file and don’t want to rename it, add the following entry in web.xml in addition to the servlet entry above.

     <context-param>
        <param-name>contextConfigLocation</param-name>
        <param-value>/WEB-INF/conf/ApplicationContext.xml</param-value>
     </context-param
    

    Here you can choose any location inside WEB-INF. Put the properties file in classes folder so that it could be found in classpath. Since you are using Eclipse embedded Tomcat, put the following as your bean configuration for property placeholder.

     <property name="location" value="classpath:../../conf/LicenseSettings.properties" /> 
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have placed my static web application in an asset folder. My static web
I have a web application with few spring portlets. Every portlet has an xml
I have an E-Commerce Rails Application where we need to output Orders placed by
In many places in our application we have code like this: using(RAPI rapi =
I have an application that has a concept of a Venue , a place
I have a layered application. I am trying to determine where to place a
I am developing an iPhone application, in a view, I have placed UITextView and
I have a Spring (3.1.) app that has a large app-context.xml file. There is
Basically I have a multi module application: data business web-app in the web-app part
I have a application that has jquery draggable div in it. I have placed

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.