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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 30, 20262026-05-30T00:24:31+00:00 2026-05-30T00:24:31+00:00

I am using spring. I need to read values from properties file. This is

  • 0

I am using spring. I need to read values from properties file. This is internal properties file not the external properties file. Properties file can be as below.

some.properties ---file name. values are below.

abc = abc
def = dsd
ghi = weds
jil = sdd

I need to read those values from the properties file not in traditional way. How to achieve it? Is there any latest approach with spring 3.0?

  • 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-30T00:24:32+00:00Added an answer on May 30, 2026 at 12:24 am

    Configure PropertyPlaceholder in your context:

    <context:property-placeholder location="classpath*:my.properties"/>
    

    Then you refer to the properties in your beans:

    @Component
    class MyClass {
      @Value("${my.property.name}")
      private String[] myValues;
    }
    

    To parse property with multiple comma-separated values:

    my.property.name=aaa,bbb,ccc
    

    If that doesn’t work, you can define a bean with properties, inject and process it manually:

    <bean id="myProperties"
          class="org.springframework.beans.factory.config.PropertiesFactoryBean">
      <property name="locations">
        <list>
          <value>classpath*:my.properties</value>
        </list>
      </property>
    </bean>
    

    and the bean:

    @Component
    class MyClass {
      @Resource(name="myProperties")
      private Properties myProperties;
    
      @PostConstruct
      public void init() {
        // do whatever you need with properties
      }
    }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I am using Spring 3.0. Can i read a property file from a localdrive
Scenario: I am parsing values from an XML file using C# and have the
Hi I'm using VBA in Excel and need to pass in the values from
I need some help in converting my script from using mysql to mysqli I
I'm writing out some xml from C# using the .net framework's XmlTextWriter. This works
I'm using the jackson library for serializing/deserializing to/from JSON. I need that this JSON
For a programming project, I need to read pixels from a loaded image using
I created a thread. How can I read values of variables from GUI thread?
I'm using reflection to create some objects. The values I'm setting are read in
I am using C# and OleDb to read data from an excel 2007 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.