0

I have a Spring Boot application. I basically need to set the following context parameter:

<context-param>
    <param-name>javax.faces.STATE_SAVING_METHOD</param-name>
    <param-value>client</param-value>
</context-param>

But my Spring Boot application doesn't have a web.xml. How can I set it programmatically?

BalusC
  • 1,082,665
  • 372
  • 3,610
  • 3,555
Tatha
  • 131
  • 1
  • 13

1 Answers1

0

Following other posts, I added a ServletContextInitializer implementation.

@Configuration
public class ConfigureJSFContextParameters implements ServletContextInitializer {

    @Override
    public void onStartup(ServletContext servletContext) throws ServletException {

        servletContext.setInitParameter("javax.faces.STATE_SAVING_METHOD", "client");

    }

}
BalusC
  • 1,082,665
  • 372
  • 3,610
  • 3,555
Tatha
  • 131
  • 1
  • 13
  • Is this the JoinFaces way of doing it? I doubt, seems the plain servlet way of doing it. JSF in SpringBoot/JoinFaces is configured differently afaik (not using Spring here, never did) – Kukeltje Oct 03 '19 at 17:14