AnsweredAssumed Answered

custom spring context

Question asked by activitinike on May 9, 2016
Latest reply on May 10, 2016 by jbarrez
Hello,

I am trying to configure custom spring context with custom java logic in actitivi-app web.cml, but it doesn't wotk.

Please guide how to configure spring context beans.

web.xml



     <listener> 
        <listener-class>org.springframework.web.context.ContextLoaderListener</listener-class> 
    </listener> 
    <context-param> 
        <param-name>contextConfigLocation</param-name> 
        <param-value>/WEB-INF/foo-spring-beans.xml</param-value> 
    </context-param>


foo-spring-beans.xml

<?xml version="1.1" 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:task="http://www.springframework.org/schema/task" xmlns:context="http://www.springframework.org/schema/context"
   xsi:schemaLocation="
        http://www.springframework.org/schema/mvc http://www.springframework.org/schema/mvc/spring-mvc-4.1.xsd
        http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-4.1.xsd
        http://www.springframework.org/schema/task http://www.springframework.org/schema/task/spring-task-4.1.xsd
        http://www.springframework.org/schema/context http://www.springframework.org/schema/context/spring-context-4.1.xsd">
       
   
 
     <!– Util bean to get custom requestFactory for RestTemplate –> 
     <bean id="restTemplateSSLUtil" class="com.mypackage.RestTemplateSSLUtil" />
   
   <!– RestTemplate with custom requestFactory –>
   <bean id="restTemplate" class="org.springframework.web.client.RestTemplate">
      <constructor-arg name="requestFactory">
         <bean factory-bean="restTemplateSSLUtil" factory-method="getRestTemplateSSLFactoryInstance" />
      </constructor-arg>
   </bean>
   
</beans>


Thanks,

Outcomes