How to add custom valve to SpaSitePipeline

Hi All,

I am trying to add a custom valve to the SpaSitePipeline. Not able to find correct bean definitions that I can override and add a valve.

There is below documentation exist that only talks about adding custom valve to default HstSitePipeline but in my case I want to add valve to the SpaSitePipeline

Please advice!! Thank you!!

Hello @savan_raiyani ,

the documentation page you have posted is correct.
You only have to do a small change in the provided XML sample.

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

  <bean id="yourCustomValve" class="com.example.valve.YourCustomValve">
    <property name="valveName" value="yourCustomValve" />
    <property name="afterValves" value="after-which-valve" />
    <property name="beforeValves" value="before-which-valve" />

  <bean class="org.springframework.beans.factory.config.MethodInvokingFactoryBean">
    <property name="targetObject">
      <bean class="org.springframework.beans.factory.config.MethodInvokingFactoryBean">
        <property name="targetObject" ref="org.hippoecm.hst.core.container.Pipelines" />
        <property name="targetMethod" value="getPipeline" />
        <property name="arguments">
          <value>PageModelPipeline</value> //Note the difference here
    <property name="targetMethod" value="addProcessingValve" />
    <property name="arguments">
      <ref bean="yourCustomValve" />


Kind regards

Did you try targeting SpaSitePipeline? What error do you get?

Hi @Lef_Karamoulas @machak

Thank you for your reply!!

Actually, I don’t know the bean definition for SpaSitePipeline or in other words I don’t have information about valves that already exist for SpaSitePipeline. This is required to configure “afterValves” and “beforeValves” properties in override file.

It’s not called SpaSitePipeline.

If you search the codebase for PageModelPipeline you will find the pipeline definition and the valves involved. The file is called SpringComponentManager-pipelines.xml in hst-core jar