Announcement Announcement Module
Collapse
No announcement yet.
Spring Expression Language SpEL => How to evaluate the absolut Path? Page Title Module
Move Remove Collapse
X
Conversation Detail Module
Collapse
  • Filter
  • Time
  • Show
Clear All
new posts

  • 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
    i found a solution:

    file:./src/main/resources/WebshereBinding

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

    Comment

    Working...
    X