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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 16, 20262026-06-16T05:21:08+00:00 2026-06-16T05:21:08+00:00

I am working on some Spring XML configuration files and sometimes they use classpath:/datasource.xml

  • 0

I am working on some Spring XML configuration files and sometimes they use "classpath:/datasource.xml" and sometimes "classpath:datasource.xml". Is there a difference between the two or is the leading / optional / implied / redundant?

  • 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-16T05:21:09+00:00Added an answer on June 16, 2026 at 5:21 am

    I don’t see any difference between these two. The biggest difference that you will see is that the relative path and the * on the classpath location

    Here is an excerpt from Spring Resources, look for section 4.7.2.2

    Classpath*:
    The “classpath*:” prefix can also be combined with a PathMatcher pattern in the rest of the location path, for example “classpath*:META-INF/*-beans.xml”. In this case, the resolution strategy is fairly simple: a ClassLoader.getResources() call is used on the last non-wildcard path segment to get all the matching resources in the class loader hierarchy, and then off each resource the same PathMatcher resoltion strategy described above is used for the wildcard subpath.

    This means that a pattern like “classpath*:*.xml” will not retrieve files from the root of jar files but rather only from the root of expanded directories. This originates from a limitation in the JDK’s ClassLoader.getResources() method which only returns file system locations for a passed-in empty string (indicating potential roots to search).

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

Sidebar

Related Questions

I'm working on rewriting some aging web applications. There are two in particular that
str_replace('Ê','',$line); Ain't working. Is there some special string that represents that?
I use Spring 3.0 and ehcache. I have added @Cacheable annotations to some methods
I have a large application spread across multiple Spring bean definition xml files. In
I'm having some problems with ActiveRecord. Well everything works fine, but it's working sometimes.
In our project we did some Maven pom.xml cleanup and dependency injection stopped working.
I am working under a spring mvc3 application. And I meet some problem when
Is there some easy to follow tutorial for a Spring MVC newbie to add
I'm working with Spring 3.0 and jUnit 4.8 and I'm trying to develop some
So, deserializing is working however I have some xml like this: <File> <Stuff>stuff</Stuff> <Devices>

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.