2014-11-03 63 views
1

我有一個web.xml與下面的過濾器配置。DelegatingFilterProxy檢索屬性值

<filter> 
    <filter-name>smplAuthenticationFilter</filter-name> 
    <filter-class>org.springframework.web.filter.DelegatingFilterProxy</filter-class> 
    <init-param> 
     <param-name>targetFilterLifecycle</param-name> 
     <param-value>true</param-value> 
    </init-param> 
</filter> 

bean定義爲smplAuthenticationFilter是象下面這樣:

<?xml version="1.0" encoding="UTF-8"?> 

<beans xmlns="http://www.springframework.org/schema/beans" 
    xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" 
    xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-3.0.xsd"> 

    <bean id="smplAuthenticationFilter" class="com.mycompany.ct.common.security.smpl.servletfilters.SmplActiveDirectoryServletFilter"> 
     <property name="databaseLoggerTarget" value="java:jdbc/smplDataSource" /> 
     <property name="smplSecurityCredentials" value="${adapter.security.smpl.credentials}" /> 
     <property name="smplSecurityPrincipal" value="${adapter.security.smpl.principal}" /> 
     <property name="smplSearchBase" value="${adapter.security.smpl.searchbase}" /> 
     <property name="smplProviderUrl" value="${adapter.security.smpl.providerurl}" /> 
     <property name="applicationName" value="smpl" /> 
    </bean> 

</beans> 

在此,我想從知道在哪裏了smplSecurityCredentialssmplSecurityPrincipalsmplSearchBasesmplProviderUrl被設置的屬性值?

換句話說,如何找到像${adapter.security.smpl.credentials}這樣的變量的值?

回答

0

您的配置文件,也應該有一些線路如:

<context:property-placeholder location="..."/> 

位置(或地點在多個文件時)將告訴你,你的屬性是

此佔位符聲明未必駐留在相同的配置文件中。 儘管它必須放置在相同的上下文定義中。 (對於相同的上下文,您可能有多個配置文件,可以使用導入或在web.xml中爲contextConfigLocation設置多個值)

+0

感謝您的回覆。你的意思是說應該存在於變量(如$ {adapter.security.smpl.credentials})被引用的文件中?我沒有找到任何這樣的線。 – Deepan 2014-11-04 06:12:45

+0

我在評論後更新了答案 – grid 2014-11-04 09:19:29