Concatenate strings within a Spring XML configuration file?

前端 未结 1 554
不思量自难忘°
不思量自难忘° 2020-12-31 03:04

I have a String value in a Spring configuration file that comes to be as the result of a JNDI lookup -- it happens to be a path name:

1条回答
  •  太阳男子
    2020-12-31 03:55

    Try using Spring EL (expression language). I would try the following (not tested):

    
    
    
        
    
    

    Not quite sure if it would work. The thing that troubles me is the cast from File (I guess) to String when concatenating. So if the previous one didn't work, I would try:

    #{myAppHomeDir.canonicalPath+'/logs'}
    

    Let us know if it works.

    0 讨论(0)
提交回复
热议问题