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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 8, 20262026-06-08T00:01:23+00:00 2026-06-08T00:01:23+00:00

I know that Spring 3.0 and up has EL, but in this case the

  • 0

I know that Spring 3.0 and up has EL, but in this case the project is using Spring 2.5 , example:

<bean id="dir" class="java.lang.String">
    <constructor-arg value="c:/work/"
</bean>

<bean id="file" class="java.lang.String">
    <constructor-arg value="file.properties" />
</bean>

<bean id="path" class="java.lang.String">
    <constructor-arg value=**dir +  file**/>
</bean>
  • 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-08T00:01:25+00:00Added an answer on June 8, 2026 at 12:01 am

    Does this work?

    <bean id="dir" class="java.lang.String">
        <constructor-arg value="c:/work/"
    </bean>
    
    <bean id="file" class="java.lang.String">
        <constructor-arg value="file.properties" />
    </bean>
    
    <bean id="path" factory-bean="dir" factory-method="concat">
        <constructor-arg ref="file"/>
    </bean>
    

    Notice the usage of String.concat(java.lang.String) method as factory-method.

    But XML isn’t really the best place for stuff like this, what about Java @Configuration?

    @Configuration
    public class Cfg {
        @Bean
        public String dir() {
            return "c:/work/";
        }
    
        @Bean
        public String file() {
            return "file.properties";
        }
    
        @Bean
        public String path() {
            return dir() + file();
        }
    }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I know that this code has a bit of smell but it suits this
I know that this topic has been beaten to death, but it seems that
This is just a curiosity question. I know that Spring can be used in
I'm using Spring, Spring Security, BlazeDS, Flex and spring-flex. I know that I can
i know that .NET String class uses such behaviour, but I can't find any
I just wants to know that is it possible to integrate Displaytag with spring
I know that %s is a string of characters, but I don't know how
I know that removing whitespaces is as easy as String.trim(). But my string contains
I've got a problem that seems simple on the face of it but has
I have a lot of methods (in this case, from web services, but maybe

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.