All Downloads are FREE. Search and download functionalities are using the official Maven repository.

spring.spring_web.xml Maven / Gradle / Ivy

<?xml version="1.0" encoding="UTF-8"?>
<beans xmlns="http://www.springframework.org/schema/beans"
       xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
       xmlns:mvc="http://www.springframework.org/schema/mvc"
       xmlns:context="http://www.springframework.org/schema/context"
       xmlns:websocket="http://www.springframework.org/schema/websocket"
       xsi:schemaLocation="
           http://www.springframework.org/schema/beans        http://www.springframework.org/schema/beans/spring-beans.xsd
           http://www.springframework.org/schema/mvc          http://www.springframework.org/schema/mvc/spring-mvc.xsd
           http://www.springframework.org/schema/context      http://www.springframework.org/schema/context/spring-context.xsd
           http://www.springframework.org/schema/websocket    http://www.springframework.org/schema/websocket/spring-websocket.xsd
       ">

    <bean class="com.testerum.web_backend.module_di.WebBackendModuleBootstrapperSpringIntegration" />

    <!-- required to be able to import a Java @Configuration into xml -->
    <context:annotation-config/>

    <!--====== FILE UPLOAD CONFIGURATION ======-->
    <bean id="multipartResolver" class="org.springframework.web.multipart.commons.CommonsMultipartResolver"/>

    <bean id="exceptionHandlerControllerAdvice" class="com.testerum.web_backend.controllers.error.ExceptionHandlerControllerAdvice" />

    <bean id="versionPropertiesConfigurer" class="org.springframework.beans.factory.config.PropertyPlaceholderConfigurer">
        <property name="location" value="classpath:/version.properties"/>
        <property name="placeholderPrefix" value="$version{" />
        <property name="placeholderSuffix" value="}" />
    </bean>

    <mvc:annotation-driven>
        <mvc:message-converters register-defaults="true">
            <bean class="org.springframework.http.converter.json.MappingJackson2HttpMessageConverter">
                <property name="objectMapper" ref="jsonObjectMapper" />
                <property name="prettyPrint" value="true"/>
            </bean>
        </mvc:message-converters>
    </mvc:annotation-driven>


    <!--====== WEB SOCKET STOMP CONFIGURATION ======-->
    <websocket:message-broker application-destination-prefix="/tests">
        <websocket:stomp-endpoint allowed-origins="*" path="/results">
            <websocket:sockjs/>
        </websocket:stomp-endpoint>
        <websocket:simple-broker prefix="/topic"/>
    </websocket:message-broker>
    <!--====== END OF - WEB SOCKET STOMP CONFIGURATION ======-->

    <!--====== WEB SOCKET CONFIGURATION ======-->
    <websocket:handlers allowed-origins="*">
        <websocket:mapping path="/tests-ws" handler="testsWebSocketController"/>
        <websocket:mapping path="/project-reloaded-ws" handler="projectReloadWebSocketController"/>
    </websocket:handlers>

    <bean class="org.springframework.web.socket.server.standard.ServletServerContainerFactoryBean">
        <property name="maxTextMessageBufferSize" value="1048576"/>
        <property name="maxBinaryMessageBufferSize" value="1048576"/>
    </bean>
    <!--====== END OF - WEB SOCKET CONFIGURATION ======-->


    <bean class="org.springframework.web.servlet.handler.SimpleUrlHandlerMapping">
        <property name="mappings">
            <props>
                <prop key="/report-results/files/**">resultsFileServerController</prop>
            </props>
        </property>
    </bean>

</beans>




© 2015 - 2025 Weber Informatics LLC | Privacy Policy