问题
I want to override two portal-impl.jar classes NtlmFiler.java and NtlmPostFilter.java, I have created an ext-plugin project and placed my custom written classes in ext-impl/src but I am unable to configure my spring.xml file to use my newly written classes instead of portal-impl classes, maybe i am totally wrong about doing it this way.
My ext-spring.xml code is :
<?xml version="1.0" encoding="UTF-8"?>
<beans>
<bean id="com.liferay.portal.servlet.filters.sso.ntlm.NtlmFilter"
class="com.liferay.portal.servlet.filters.sso.ntlm.NtlmFilter">
<property name="ntlmFilter">
<bean class="com.sso.ntlm.filter.CustomNtlmFilter">
<property name="CustomNtlmFilter" ref="customNtlmFilter" />
</bean>
</property>
</bean>
<bean id="com.liferay.portal.servlet.filters.sso.ntlm.NtlmPostFilter"
class="com.liferay.portal.servlet.filters.sso.ntlm.NtlmPostFilter">
<property name="ntlmPostFilter">
<bean class="com.sso.ntlm.filter.CustomNtlmPostFilter">
<property name="CustomNtlmPostFilter" ref="customNtlmPostFilter" />
</bean>
</property>
</bean>
Note: The idea is to solve this problem
回答1:
As the NtlmFilter
is no Spring bean, there is no use to define it in ext-spring.xml
.
See portal.properties
:
# ... and the filter
# com.liferay.portal.servlet.filters.sso.ntlm.NtlmFilter must be referenced
# in web.xml.
So you just need to reference your filter class instead in liferay-web.xml
or web-ext.xml
(I don't know if the later works for overrides).
The same applies to the NtlmPostFilter
.
来源:https://stackoverflow.com/questions/45915136/how-to-override-portal-impl-jar-classes-in-liferay-ext-plugin