custom spring context
Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-09-2016 10:57 AM
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
foo-spring-beans.xml
Thanks,
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,
Labels:
- Labels:
-
Archive
1 REPLY 1
Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-10-2016 06:32 AM
The web.xml is not read. You need to have beans with @Configuration on your classpath in a component scanned package.
Which environment are you trying this on?
Which environment are you trying this on?
