Search in sources :

Example 66 with TomcatServletWebServerFactory

use of org.springframework.boot.web.embedded.tomcat.TomcatServletWebServerFactory in project Assignment by WMPeople.

the class AssignmentApplication method servletContainer.

@Bean
public ServletWebServerFactory servletContainer() {
    TomcatServletWebServerFactory tomcat = new TomcatServletWebServerFactory();
    if (tomcatAjpEnabled) {
        Connector ajpConnector = new Connector(ajpProtocol);
        ajpConnector.setPort(ajpPort);
        ajpConnector.setSecure(false);
        ajpConnector.setAllowTrace(false);
        ajpConnector.setScheme("http");
        tomcat.addAdditionalTomcatConnectors(ajpConnector);
    }
    return tomcat;
}
Also used : Connector(org.apache.catalina.connector.Connector) TomcatServletWebServerFactory(org.springframework.boot.web.embedded.tomcat.TomcatServletWebServerFactory) FilterRegistrationBean(org.springframework.boot.web.servlet.FilterRegistrationBean) SqlSessionFactoryBean(org.mybatis.spring.SqlSessionFactoryBean) Bean(org.springframework.context.annotation.Bean)

Aggregations

TomcatServletWebServerFactory (org.springframework.boot.web.embedded.tomcat.TomcatServletWebServerFactory)66 Test (org.junit.jupiter.api.Test)28 AccessLogValve (org.apache.catalina.valves.AccessLogValve)24 Test (org.junit.Test)18 HashMap (java.util.HashMap)13 Bean (org.springframework.context.annotation.Bean)9 WebApplicationContextRunner (org.springframework.boot.test.context.runner.WebApplicationContextRunner)6 TomcatWebServer (org.springframework.boot.web.embedded.tomcat.TomcatWebServer)6 Connector (org.apache.catalina.connector.Connector)5 Valve (org.apache.catalina.Valve)4 RemoteIpValve (org.apache.catalina.valves.RemoteIpValve)4 Context (org.apache.catalina.Context)3 TomcatContextCustomizer (org.springframework.boot.web.embedded.tomcat.TomcatContextCustomizer)3 UndertowServletWebServerFactory (org.springframework.boot.web.embedded.undertow.UndertowServletWebServerFactory)3 AnnotationConfigServletWebServerApplicationContext (org.springframework.boot.web.servlet.context.AnnotationConfigServletWebServerApplicationContext)3 ApplicationContext (org.springframework.context.ApplicationContext)3 ServletContext (jakarta.servlet.ServletContext)2 lombok.val (lombok.val)2 ErrorReportValve (org.apache.catalina.valves.ErrorReportValve)2 AbstractProtocol (org.apache.coyote.AbstractProtocol)2