Question

I have a class called ApplicationConversionServiceFactoryBean which is configured inside webmvc-config.xml as conversion-service:

ApplicationConversionServiceFactoryBean

@RooConversionService
public class ApplicationConversionServiceFactoryBean extends FormattingConversionServiceFactoryBean {

    @SuppressWarnings("deprecation")
    @Override
    protected void installFormatters(FormatterRegistry registry) {
        super.installFormatters(registry);
        // Register application converters and formatters
    }

}

part of webmvc-config.xml

<mvc:annotation-driven  conversion-service="applicationConversionService"/> 
<bean class="com.palak.uauth.web.ApplicationConversionServiceFactoryBean" id="applicationConversionService"/>

I have Eclipse Birt integrated with my application which forces me to remove that <mvc annotaion-driven /> line.

So what do i do to register my conversion-service by any other way,so that, i dont have that mvc annotaion tag anymore?

Was it helpful?

Solution

I'd suggest solving the root cause, i.e. BIRT fighting with your XML namespaces. Either check what the exact namespace error is and address that, or alternatively, configure Spring MVC using an @Configuration class with an @EnableWebMvc annotation.

You can easily mix XML and Java configuration, you simply need to component scan your @Configuration class in your XML files.

OTHER TIPS

Its working..This is what i did..

made new class called MyMvcConvertor

MyMvcConvertor.java

@Configuration
@EnableWebMvc
@ComponentScan({"com.palak.uauth.web"})
public class MyMvcConvertor extends WebMvcConfigurationSupport{

    @Bean
    public FormattingConversionService mvcConversionService() {
        FormattingConversionService conversionService = new ApplicationConversionServiceFactoryBean().getObject();
        addFormatters(conversionService);
        return conversionService;
    }

}

define new bean def inside webmvc-config.xml

<bean class="com.palak.uauth.web.MyMvcConvertor" id="applicationConversionService"/>
Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top