Results 1 to 2 of 2

Thread: Spring Expression Language SpEL => How to evaluate the absolut Path?

  1. #1
    Join Date
    Jan 2010
    Posts
    11

    Default Spring Expression Language SpEL => How to evaluate the absolut Path?

    Hi

    we use some library that requires a absolute path as a parameter.

    Code:
    <bean id="jndiTemplate" class="org.springframework.jndi.JndiTemplate">
    	<property name="environment">
    		<props>
    			<prop key="java.naming.factory.initial">
    				com.sun.jndi.fscontext.RefFSContextFactory
    			</prop>
    			<prop key="java.naming.provider.url">
    			file:C:\local\workspaces\projectA\src\main\resources\WebshereBinding
    			</prop>
    		</props>
    	</property>
    </bean>
    there is no way around that :-(

    i can make it run it with something like that:
    Code:
    <prop key="java.naming.provider.url">
      file:#{ systemProperties['user.path'] }/src/main/resources/WebshereBinding
    </prop>
    and -Duser.path=C:/local/workspaces/projectA

    but is not sooooooo coooool :-(

    does somebody not if this is possible to do dynamically in Spring or SpringEL
    Code:
    <prop key="java.naming.provider.url">
      file:#{ ??evalRootPath?? }/src/main/resources/WebshereBinding
    </prop>
    thanks :-)

  2. #2
    Join Date
    Jan 2010
    Posts
    11

    Default

    i found a solution:

    file:./src/main/resources/WebshereBinding

    but it would be nice to know if spring EL could do it!

Tags for this Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •