小编Lal*_*hra的帖子

如何使用grep仅匹配行尾字符的奇数出现

例如,我正在匹配 'a' 的奇数出现。所以“helloaaa”应该匹配而“helloaaaa”不应该匹配。

我还在 bash 上尝试过带和不带 -E 选项的“(aa)*a$”。

regex grep

3
推荐指数
1
解决办法
2812
查看次数

无法使PropertyPlaceholderConfigurer工作

我正在使用LDAP来验证Web应用程序中的用户.LDAP相关bean在一个名为spring-servlet-security-ldap.xml(ldap.xml现在称为on)的单独文件中配置.我的主Web应用程序上下文文件'spring-servlet.xml'导入spring-servlet-security.xml,它再次导入ldap文件.如果我不使用属性文件,此设置有效.

我已经包含了层次结构详细信息,因为类似的问题网站PropertyPlaceholderConfigurer被覆盖了原因.

ldap设置的属性文件放在WEB-INF目录中.

我已经定义了PropertyPlaceholderConfigurerldap.xml如下

<bean id="placeHolderConfigurer" class="org.springframework.beans.factory.config.PropertyPlaceholderConfigurer">
    <property name="location"><value>WEB-INF/ldap.properties</value></property>
</bean>
Run Code Online (Sandbox Code Playgroud)

我在同一个文件中引用属性

<bean id="contextSource" class="org.springframework.security.ldap.DefaultSpringSecurityContextSource" depends-on="placeHolderConfigurer">
    <constructor-arg value="ldap://xx.xx.xx.xx:389/dc=example,dc=com" />
    <property name="userDn"><value>{ldap.userDN}</value></property>
    <property name="password" value="secret" />
</bean>
Run Code Online (Sandbox Code Playgroud)

日志表明正在加载该属性.

INFO Thread-0 org.springframework.beans.factory.config.PropertyPlaceholderConfigurer - Loading properties file from ServletContext resource [/WEB-INF/ldap.properties]
Run Code Online (Sandbox Code Playgroud)

但是没有为该值引用属性文件,并且正在使用字面配置的值.我已经从数据包跟踪验证了绑定请求是针对DN的{ldap.userDN}.

spring

2
推荐指数
1
解决办法
2606
查看次数

标签 统计

grep ×1

regex ×1

spring ×1